diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6e5245f3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: 'release' + +on: + create: + tags: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v2.x + + - name: Inject JDK + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Build with Maven + run: mvn package + + - name: Create Artefaktes + run: mvn install + + - name: Upload Release Asset + id: upload-release-asset + uses: meeDamian/github-release@2.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + gzip: false + body: > + aktuelles Changelog befindet sich [hier](https://github.com/applejuicenet/gui-java/blob/master/CHANGELOG.md) + files: > + target/AJCoreGUI.zip + target/AJCoreGUI.zip.sha256.txt + target/AJCoreGUI.macOS.zip + target/AJCoreGUI.macOS.zip.sha256.txt + + - name: trigger homebrew update + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.REPO_DISPATCH_TOKEN }} + repository: applejuicenet/homebrew-packages + event-type: gui-update + + - name: trigger snapcraft update + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.REPO_DISPATCH_TOKEN }} + repository: applejuicenet/gui-java + event-type: snapcraft-update diff --git a/.github/workflows/snapcraft.yml b/.github/workflows/snapcraft.yml new file mode 100644 index 00000000..ea1b61dc --- /dev/null +++ b/.github/workflows/snapcraft.yml @@ -0,0 +1,31 @@ +name: 'snapcraft' + +on: + workflow_dispatch: + repository_dispatch: + types: [ snapcraft-update ] + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: get latest tag + id: latestrelease + run: | + echo "::set-output name=version::$(curl -s https://api.github.com/repos/applejuicenet/gui-java/releases/latest | jq -r '.tag_name')" + + - name: confirm tag + run: | + echo ${{ steps.latestrelease.outputs.releasetag }} + + - name: update snapcraft + run: | + sed -i "" 's#version: [0-9]*.[0-9]*.[0-9]*#version: ${{ steps.latestrelease.outputs.releasetag }}#' snap/snapcraft.yaml + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + file_pattern: snap/snapcraft.yaml + commit_message: Update Snapcraft Package to ${{ steps.latestrelease.outputs.releasetag }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..47dccc50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.idea +target/ +dependency-reduced-pom.xml +*.iml +*.jar +*.zip +*.exc + +pom.xml.versionsBackup diff --git a/.run/ajgui.run.xml b/.run/ajgui.run.xml new file mode 100644 index 00000000..55ad2a4a --- /dev/null +++ b/.run/ajgui.run.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/AJClientGUI/.classpath b/AJClientGUI/.classpath deleted file mode 100644 index eec03aac..00000000 --- a/AJClientGUI/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/AJClientGUI/.cvsignore b/AJClientGUI/.cvsignore deleted file mode 100644 index be91983b..00000000 --- a/AJClientGUI/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -AJCoreGUI.jar -*.properties -AJCoreGUI_v*.zip diff --git a/AJClientGUI/.project b/AJClientGUI/.project deleted file mode 100644 index ef789a9d..00000000 --- a/AJClientGUI/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - AJClientGUI - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/AJClientGUI/.settings/org.eclipse.jdt.core.prefs b/AJClientGUI/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0a67b997..00000000 --- a/AJClientGUI/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,296 +0,0 @@ -#Fri Feb 18 17:19:19 CET 2005 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=ignore -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -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_method_declaration=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_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.compiler.debug.localVariable=generate -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_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -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_local_declarations=insert -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not 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_closing_paren_in_enum_constant=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_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -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_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=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_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=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_between_empty_braces_in_array_initializer=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_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=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_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=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.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -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_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=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_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 diff --git a/AJClientGUI/.settings/org.eclipse.jdt.ui.prefs b/AJClientGUI/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index c8400e74..00000000 --- a/AJClientGUI/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Fri Feb 18 17:19:19 CET 2005 -comment_format_source_code=true -comment_new_line_for_parameter=true -comment_format_html=true -comment_line_length=80 -comment_format_header=false -eclipse.preferences.version=1 -comment_indent_parameter_description=true -comment_format_comments=true -comment_separate_root_tags=true -comment_clear_blank_lines=false -comment_indent_root_tags=true diff --git a/AJClientGUI/AJCoreGUI.jpx b/AJClientGUI/AJCoreGUI.jpx deleted file mode 100644 index 602a9ba2..00000000 --- a/AJClientGUI/AJCoreGUI.jpx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AJClientGUI/AJLibs.library b/AJClientGUI/AJLibs.library deleted file mode 100644 index 4d788075..00000000 --- a/AJClientGUI/AJLibs.library +++ /dev/null @@ -1,14 +0,0 @@ - - - - AJLibs - - [tools/pack.jar] - [tools/xercesImpl.jar] - [needed_jars/skinlf.jar] - [needed_jars/looks-1.2.1.jar] - [needed_jars/log4j-1.2.8.jar] - [tools/xml-apis.jar] - - 1078938164290 - diff --git a/AJClientGUI/ApplejuiceGUI mit Plugins.launch b/AJClientGUI/ApplejuiceGUI mit Plugins.launch deleted file mode 100644 index 0b1d110d..00000000 --- a/AJClientGUI/ApplejuiceGUI mit Plugins.launch +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/AJClientGUI/ApplejuiceGUI.launch b/AJClientGUI/ApplejuiceGUI.launch deleted file mode 100644 index 5755a45b..00000000 --- a/AJClientGUI/ApplejuiceGUI.launch +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/AJClientGUI/Doku/HowTo_PartList.txt b/AJClientGUI/Doku/HowTo_PartList.txt deleted file mode 100644 index b1acb6fd..00000000 --- a/AJClientGUI/Doku/HowTo_PartList.txt +++ /dev/null @@ -1,55 +0,0 @@ -[10:08:52] (Maj0r|ajGUIen) jo, hast du grad zeit, dass du mir die nochmal kurz in voller epischer breite erklren kannst? -[10:09:16] (muhviehstarr) warte ihc nehm mir dazu die doku her ;) -[10:11:01] (muhviehstarr) k -[10:11:26] (muhviehstarr) du kriegst am anfang erstmal fileinformation -[10:11:31] (muhviehstarr) mit der gre der datei in bytes -[10:11:37] (Maj0r|ajGUIen) ja -[10:12:18] (muhviehstarr) so -[10:12:21] (muhviehstarr) nach fileinformation -[10:12:32] (muhviehstarr) kriegste paar parts -[10:12:42] (Maj0r|ajGUIen) paar tausend -[10:12:47] (muhviehstarr) jop -[10:12:49] (muhviehstarr) je nach file -[10:12:52] (muhviehstarr) da steht dann drin -[10:12:53] (Maj0r|ajGUIen) jop -[10:13:14] (muhviehstarr) -[10:13:15] (muhviehstarr) so -[10:13:25] (muhviehstarr) -[10:13:31] (muhviehstarr) -[10:13:40] (muhviehstarr) das wre jetzt eine gltige bergabe -[10:13:41] (muhviehstarr) das heit -[10:13:49] (muhviehstarr) vom byte 0 bis byte 1000 hat man das file (-1) -[10:14:02] (Maj0r|ajGUIen) ok -[10:14:06] (muhviehstarr) dann von 1000 bis 2000 hat man nix, und ist auch nix zu sehen (0) -[10:14:20] (muhviehstarr) von 2000 bis gre aus fileinformation hat man wieder das file (-1) -[10:15:47] (Maj0r|ajGUIen) und die parts sind nicht immer gleich gro, sondern die gre richtet sich nach der anzahl der parts hintereinander mit der gleichen verfgbarkeit? -[10:15:58] (muhviehstarr) nein -[10:16:13] (muhviehstarr) die partgre gilt von fromposition bis fromposition vom nchsten -[10:16:25] (muhviehstarr) egal wie verfgbar die sind, noch ob man das hat oder nicht -[10:16:38] (muhviehstarr) wenn es kein nachfolger gibt, ist das ende natrlich filegre -[10:16:43] (muhviehstarr) steht auch so unter der tabelle -[10:17:18] (Maj0r|ajGUIen) klar. aber theoretisch kann jeder part eine andere gre haben, oder? -[10:17:32] (Maj0r|ajGUIen) oder nur der letzte? -[10:17:40] (muhviehstarr) ja jeder -[10:17:46] (muhviehstarr) und nicht nur theoretisch -[10:17:50] (muhviehstarr) das wird eher fters passieren -[10:18:09] (Maj0r|ajGUIen) ok -[10:18:32] (Maj0r|ajGUIen) kann man sich darauf verlassen, dass in der xml die parts in der richtigen reihenfolge stehen? -[10:18:41] (muhviehstarr) ja -[10:19:46] (Maj0r|ajGUIen) wie hast du deine tabelle gemacht? eine spezielle anzahl von kstchen durch die gre der datei geteilt und diese dann entsprechend ausgewertet? -[10:20:16] (muhviehstarr) ich rechne mir aus -[10:20:26] (muhviehstarr) bei ner reihenhhe von 16 pixel -[10:20:33] (muhviehstarr) und mein bereich ist 400 pixel breit -[10:20:39] (muhviehstarr) und vielleicht 160 pixel hoch -[10:20:53] (muhviehstarr) krieg ich also 10 reihen 400 pixel rein -[10:20:59] (muhviehstarr) sprich ich hab 4000 pixel -[10:21:09] (muhviehstarr) dann ist die datei 400000 byte gro -[10:21:21] (muhviehstarr) sprich 1 pixel reprsentiert 100 bytes -[10:21:38] (muhviehstarr) wenn ich jetzt male das ich von 0 bis 2000 die file habe -[10:21:51] (muhviehstarr) male ich von pixel 0 bis 20 in reihe ein den bereich schwarz -[10:22:08] (Maj0r|ajGUIen) ok, jetzt hab ichs gerafft :-) -[10:22:22] (Maj0r|ajGUIen) danke fr das epische meisterwerk;) -[10:22:27] (muhviehstarr) lol -[10:22:34] (muhviehstarr) reiner eigenntz -[10:22:45] (Maj0r|ajGUIen) ich glaub, ich werde diese erluterung mal als doku mit einchecken. -[10:23:06] (muhviehstarr) lol \ No newline at end of file diff --git a/AJClientGUI/Doku/version.txt b/AJClientGUI/Doku/version.txt deleted file mode 100644 index 20dee5f6..00000000 --- a/AJClientGUI/Doku/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.56.0|http://download.berlios.de/applejuicejava/AJCoreGUI_Win_v0_56_0.zip|http://download.berlios.de/applejuicejava/AJCoreGUI_v0_56_0.zip \ No newline at end of file diff --git a/AJClientGUI/WICHTIG_LESEN.txt b/AJClientGUI/WICHTIG_LESEN.txt deleted file mode 100644 index c7eef93c..00000000 --- a/AJClientGUI/WICHTIG_LESEN.txt +++ /dev/null @@ -1,13 +0,0 @@ -WICHTIG!!! - -Um die Link-Catch-Funktion zu nutzen, muss die .reg-Datei an die eigene Umgebung angepasst und importiert werden. - - -Beispiel: - - -Original: -@="\"C:\\AJClientGUI\\AJCoreGUI.exe\" \"-link=%1\" \"-path=C:\\AJClientGUI\"" - -Wenn Du die exe in "c:\programme\aj" liegen hast, wrde die Zeile so aussehen: -@="\"c:\\programme\\aj\\AJCoreGUI.exe\" \"-link=%1\" \"-path=c:\\programme\\aj\"" \ No newline at end of file diff --git a/AJClientGUI/aj_winlinkadapter_nt_2000_xp.reg b/AJClientGUI/aj_winlinkadapter_nt_2000_xp.reg deleted file mode 100644 index e3da9d00..00000000 --- a/AJClientGUI/aj_winlinkadapter_nt_2000_xp.reg +++ /dev/null @@ -1,12 +0,0 @@ -REGEDIT4 - -[HKEY_CLASSES_ROOT\ajfsp] -@="URL: Applejuice Protocol" -"URL Protocol"="" - -[HKEY_CLASSES_ROOT\ajfsp\shell] - -[HKEY_CLASSES_ROOT\ajfsp\shell\open] - -[HKEY_CLASSES_ROOT\ajfsp\shell\open\command] -@="\"C:\\AJClientGUI\\AJCoreGUI.exe\" \"-link=%1\" \"-path=C:\\AJClientGUI\"" diff --git a/AJClientGUI/ajcore.properties b/AJClientGUI/ajcore.properties deleted file mode 100644 index 5e8ae2e4..00000000 --- a/AJClientGUI/ajcore.properties +++ /dev/null @@ -1,2 +0,0 @@ -releaseinfo.host=http://applefiles.cc -releaseinfo.port=80 \ No newline at end of file diff --git a/AJClientGUI/build/MANIFEST.MF b/AJClientGUI/build/MANIFEST.MF deleted file mode 100644 index 18a39d5b..00000000 --- a/AJClientGUI/build/MANIFEST.MF +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: ./needed_jars/log4j-1.2.8.jar ./needed_jars/skinlf.jar ./n - eeded_jars/looks-1.2.1.jar -Main-Class: de.applejuicenet.client.AppleJuiceClient - diff --git a/AJClientGUI/build/build.xml b/AJClientGUI/build/build.xml deleted file mode 100644 index b17f6ba7..00000000 --- a/AJClientGUI/build/build.xml +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AJClientGUI/build/readme.first b/AJClientGUI/build/readme.first deleted file mode 100644 index 3cbb6c02..00000000 --- a/AJClientGUI/build/readme.first +++ /dev/null @@ -1,11 +0,0 @@ -Ant-Anleitung: - -1. ant installieren (mindestens ant 1.5.1) -2. in build-Ordner wechseln und "ant complete" starten -3. um andere ant-targets zu starten, "ant help" ausfhren - - -Ant-HowTo: -1. install ant (minimum ant version 1.5.1) -2. move to build-directory and execute "ant complete" -3 to execute further ant-targets, see defined ant-targets with "ant-help" \ No newline at end of file diff --git a/AJClientGUI/changelog.htm b/AJClientGUI/changelog.htm deleted file mode 100644 index e240fc8f..00000000 --- a/AJClientGUI/changelog.htm +++ /dev/null @@ -1,910 +0,0 @@ - - - - - - - -

Changelog -

-GUI
-IRC-Plugin
-
-GUI
-
-
Version 0.71.2:
-- [Maj0r] Release-Info auf applefiles.cc umgestellt
-
-
Version 0.71.0:
-- [Maj0r] Sortierung der Tabellen wird gespeichert
-- [Maj0r] Menpunkt Release-Info in Share, Suche und Download hinzugefügt
-- [Maj0r] Bäume in Suche, Download und Upload durch Tabellen ersetzt
-
-
Version 0.70.5:
-- [Maj0r] Fehler beim Hinzufügen von Share-Ordnern behoben
-- [Maj0r] Priorität der Uploads in der Form 1:2,2 (Priowert) anzeigen
-- [Maj0r] Sortierung im Downloadreiter korrigiert
-
-
Version 0.70.4:
-- [Maj0r] Deadlock beim Start gefixt
-- [Maj0r] Anzeige der Downloadgechwindigkeit und des Gesamtdown- und uploads korrigiert
-- [Maj0r] PwDl der Uploads in der Form 1:2,2 anzeigen
-- [Maj0r] Mit Java6 lassen sich bei lokaler Coreverbindung Sharedateien und laufende Downloads nun mit dem Standardprogramm öffnen
-- [Maj0r] Bug #670 Reiter per Tastaturschnelltaste anwaehlbar
-
-
Version 0.70.2:
-- [Maj0r] Core-Versionsprüfung gefixt
-
-
Version 0.70.1:
- -Java ab 5.0 wird benötigt
-- [Maj0r] TrayIcon von Java6 eingebaut
-     TrayIcon funktioniert nun unter Windows, Mac und Linux (Gnome-Tray und KDE-Tray)
-- [Maj0r] CPU-Last der Suchergebnisdarstellung wesentlich verringert
-     Nun sind auch groe Treffermengen gut verwendbar (Test mit 1500 bis 2000 Treffern pro Suche bei 3 Suchen).
-     Lediglich das initiale Laden der Treffer dauert etwas, das Zeug muss halt ber die Leitung und einmal geparst werden.
-- [Maj0r] Anzahl aller unterschiedlichen gefundenen Dateien einer Suche wird im Suchergebnisreiter angezeigt
-- [Maj0r] Ist beim Start Loglevel Debug eingestellt, wird ein weiterer Reiter "Debug" angezeigt, der alle Lognachrichten enthlt
-- [Maj0r] Featurerequest (Danke an fdh)
-     Gesamtpunkte der gesetzten Priorität wird im Sharebereich ( x/1000 ) angezeigt.
-- [Maj0r] TKLControls eingebaut (www.tkl-soft.de)
-     In den Optionen und im Wizard werden nun Felder mit modifizierten Werten blau umrahmt. Mit Strg+z kann der Ursprungswert wieder hergestellt werden.
-     Ungültige Werte werden rot umrahmt (z.B. im Downloadlinkfeld im Downloadbereich).
-- [Maj0r] Bug #527 gefixt (Danke an fdh)
-     100%-CPU-Bug behoben. Trat immer auf, wenn man die Größe der Partliste veränderte.
-- [Maj0r] Featurerequest #476 (Danke an clickweg)
-     Suchergebnisse, die bereits im Temp oder im Share vorhanden sind, werden grün markiert.
-- [Maj0r] GUI komplett refactored und auf die neue CoreFassade 1.0 umgebaut
-     Infos dazu auf applejuicenet.de
-- [loevenwong] Featurerequest #549 (Danke an xxluckystrikexx)
-     Automatischen Powerdownload komplett überarbeitet.
-
-
Version 0.61.2:
-- [Maj0r] Bug #528 gefixt (Danke an akku)
-     Deadlock bei der Darstellung der Partliste behoben.
-- [Maj0r] Bug #525 gefixt (Danke an akku und apokalypse1982)
-     Das GUI nutzte bei ungünstiger Datenkonstellation 100% CPU-Zeit.
-
-
Version 0.61.1:
-- [Maj0r] Auf vielfachen Wunsch Partlistanzeige wieder auf mehrere Threads aufgeteilt. Braucht wieder etwas mehr Ressourcen, ist aber beim gefühlten Laden schneller.
-- [Maj0r] Bug #524 gefixt (Danke an akku und fdh)
-- [Maj0r] Bug gefixt
-     Nach Benutzung von "Priorität löschen" wurde die View nicht aktualisiert.
-
-
Version 0.61.0:
-Core ab Version 0.30.146.1202 -wird benötigt
-- [Maj0r] Wenn ein Download hinzugefügt wird, gibt es nun, wenn der Core einen Fehler meldet, eine Benachrichtigung.
-- [Maj0r] Bug gefixt (Danke an Up)
-     Coreseitig beendete Suchen werden nun auch im GUI als beendet dargestellt.
-- [Maj0r] skinlf.jar aktualisiert
-- [Maj0r] ajl-Listen können nun direkt mit Angabe eines Zielverzeichnisses importiert werden
-- [Maj0r] Downloads können nun direkt mit Angabe eines Zielverzeichnisses gestartet werden
-- [Maj0r] Anzeige zusätzlicher Information gesharter Dateien (Datum letzter Anfrage, Anzahl Downloadanfragen, Anzahl Suchanfragen)
-- [Maj0r] Bug gefixt
-     Es konnte mit jedem offenen Port eine Verbindung hergestellt werden, das GUI blieb anschließend leer.
-     Unterscheidung zwischen ungültiger Coreadresse und falschem Passwort eingebaut.
-- [Maj0r] Featurerequest #465 (Danke an clickweg)
-     Beim ersten Start des GUIs wird versucht, anhand der Standardeinstellungen zu verbinden.
-- [Maj0r] Die Datei properties.xml wurde durch die Datei ajgui.properties ersetzt.
-- [Maj0r] Einschränkung aufgehoben
-     Im Verbindungsdialog können nun beliebig viele Cores gespeichert werden.
-- [Maj0r] Bug #490 gefixt (Danke an Up)
-     Umlaute sind nun in Verzeichnis- und Dateinamen in den Optionen möglich.
-- [Maj0r] Bug gefixt
-     Im Verbindungsdialog funktionierte die Datenübernahme nicht, wenn im Host- oder Passwortfeld Return betätigt wurde.
-- [Maj0r] Featurerequest #475 (Danke an clickweg)
-     Anzeige der Verfügbarkeit in Prozent der aktuell gezeigten Partliste.
-- [Maj0r] Featurerequest #481 (Danke an johannes8)
-     Firewall-Warnung wird nun zusätzlich als Symbol und als Tooltipp ganz links in der Statusleiste angezeigt.
-- [Maj0r] Bug #494 gefixt (Danke an dsp2004)
-- [Maj0r] Bug #505 gefixt (Danke an rexcorda)
-- [loevenwong] Focus wird auf das Passwort-Feld gesetzt.
-
-Version 0.60.0:

-- [Maj0r] Featurerequest #472 (Danke an clickweg)
-     Downloads, Shares und Suchergebnisse werden -nun mit passenden Icons -dargestellt (vgl. Suche).
-- [loevenwong] Featurerequest #458; Verbindungswizard kann -über Optionen->Verbindungen gestartet werden.
-
- [loevenwong] Featurerequest #414 (Danke an clickweg)
-     Download-Tooltipps können per -Optionen->Ansicht -deaktiviert werden.
-- [loevenwong] Wenn automatisch Verbinden ausgewählt ist, wird -anschliessend noch geprüft, ob die SHIFT-Taste gedrückt wird -(nach Erscheinen des Splash-Screens),
-     falls doch ein anderer Core verwendet -werden soll.
-
- [loevenwong] Tastaturereignisse beim Anmeldedialog um -ENTER/ESCAPE erweitert.
-
-- [Maj0r] Featurerequest
-     Unter Optionen->Ansicht kann ein Programm -ausgewählt werden (z.B. VLC).
-     Wenn der Core auf dem gleichen Rechner wie das -GUI läuft, dann wird in der Downloadtabelle und in der -Sharetabelle im Kontextmenü ein -neuer Menüpunkt aktiviert.
-     Mit diesem wird der Shareeintrag an das -verknüpfte Programm übergeben.
-- [Maj0r] Bug #175 gefixt (Danke an jr17)
-     TrayIcon gefixt.
-- [Maj0r] Bug #413 gefixt (Danke an hirsch.marcel)
-     Leere Suchen werden nicht mehr -ausgeführt. Leerstellen am Anfang und am Ende eines Suchbegriffs -werden entfernt.
-- [Maj0r] Featurerequest #442 (Danke an clickweg)
-     Uploads können nun per Kontextmenü -als Links in die Zwischenablage kopiert werden.
-- [Maj0r] Stats eingebaut. Parameter: -command=getajstats
-- [loevenwong] Versionsanzeige eingebaut. Parameter: -command=getajinfo
-
-Version 0.59.3:
-
-- [Maj0r] Bugfix (Danke an muhviehstarr)
-     Zwei Deadlocks behoben. Einer bewirkte, dass -das GUI beim Start beim Splashscreen hängen bleiben konnte.
-- [Maj0r] \n in der Servernachricht wird nicht mehr beachtet. -Html-Tags verwenden.
-- [Maj0r] Featurerequest
-     Automatischer Powerdownload pausiert nun -standardmäßig nicht mehr die Downloads.
-     Außerdem kann nun ein -Einstellungendialog implementiert werden, um Anpassungen während -des Betriebs des autom. Pwdls vorzunehmen.
-- [Maj0r] Bugfix
-     Bei sehr hohen Maxupload- und/oder -Maxdownloadwerten kam es zu Fehlern im TrayIcon.
-- [Maj0r] Bug #421 gefixt (Danke an Up)
-     Wizard wurde um Standardeinstellungen für -DSL 1000, DSL 2000 und DSL 3000 erweitert.
-- [Maj0r] Bug #423 gefixt (Danke an hirsch.marcel und Up)
-     Aktive, indirekte Uploads werden wieder -angezeigt.
-- [Maj0r] Dreckigen Rest im Uploadbereich entfernt.
-

Version 0.59.2:
-
- [Maj0r] Bug #420 gefixt (Danke an Up)
-     Ganz frischen NullPointer gefixt.
-

-

Version 0.59.1:
-
Core ab Version 0.30.145.610 -wird benötigt -
-- [Maj0r] Wasserstände der einzelnen Uploader werden angezeigt.
-- [Maj0r] Beim Serverwechsel wird nun eine qualifizierte Warnung -ausgegeben, wenn die aktuelle Verbindung noch keine 30 Minuten besteht.
-- [Maj0r] Bugfix
-     Beim Neuerzeigen der properties.xml wurden die -neuen Coredaten nicht für die aktuelle Sitzung übernommen.
-     Folge war ein Verbindungsverlust.
-
-
Version 0.59.0:
-
- [Maj0r] Durch Ändern einer Source-Variable in der -AutomaticPowerdownloadPolicy.java kann das Pausieren von Dateien -verhindert werden.
-- [Maj0r] Bug #392 gefixt (Danke an Up und jr17)
-     Im Zuge der XML-Parser-Umstellung (0.56.1) ist -die Firewallwarnung verschütt gegangen.
-- [Maj0r] Icons für Uploads in der Warteschlange korrigiert.
-- [Maj0r] Downloadadresse für die Updateinfodatei auf Wunsch der -berlios-Crew von berlios.de auf tkl-soft.de geändert.
-- [Maj0r] Uploads, die zwar in der Warteschlange sind, aber keine -aktive -Verbindung halten, werden jetzt im dreckigen Rest angezeigt.
-

-

Version 0.58.0:
-
Core ab Version 0.30.144.522 -wird benötigt
-- [Maj0r] Bug #360 gefixt (Danke an fapu & panterfrau)
-     Beim Linkklicken konnte es passieren, dass -zwei GUIs gestartet werden.
-- [Maj0r] Bug #361 gefixt (Danke an panterfrau)
-     Logfehlermeldung bei überlastetem Core -wird nun nur noch als Debug gelogt.
-- [Maj0r] Featurerequest (Danke an Up)
-     Bei Servern ohne Namen wird nun im -Startbereich IP:Port angezeigt.
-- [Maj0r] Willkommensnachricht des Servers eingebaut.
-- [Maj0r] Anzeige, ob die Warteschlange voll ist, im Uploadbereich -eingebaut.
-- [maj0r] In der Statusspalte eines nicht aktiven Uploads wird nun die -Corezeit -der letzen Aktivität angezeigt.
-

-

Version 0.57.1:
-
-- [Maj0r] Bugfix (Danke an mich ;) )
-     Beim Laden von Plugins konnten Fehler beim -Classloading auftreten. Wenn der Statusbalken bei "Lade Plugins..." -hängen bleibt, bitte updaten.
-- [Maj0r] Change (Danke an hirsch.marcel)
-     Irc-Server im Infodialog angepasst.
-- [Maj0r] Archivdifferenzierung beseitigt (Besonderen Dank an Up -für die -Windows-Starter-Exe !!)
-     Es gibt fortan keine separaten Archive mehr -für Windows und andere Betriebssysteme.
-- [Maj0r] Featurerequest #319 (Danke an tom62)
-     Sortierung im Dateilistenexport eingebaut.
-- [Maj0r] Bugfix (Danke an muhviehstarr)
-     Sortierung nach Zeit in der Serveranzeige -korrigiert.
-- [Maj0r] Bug #322 gefixt (Danke an torsten_altreiter)
-     Der Dateiname wurde per Linkübernahme aus -der Suche nicht korrekt übernommen.
-- [loevenwong] Updateprüfung auch per Menüeintrag -ermöglicht.
-- [Maj0r] Standardaussehen auf JGoodies geändert (weniger -ressourcenlastig)
-     Themes können natürlich weiterhin -verwendet werden.
-

-

Version 0.57.0:
-- [Maj0r] Bugfix (Danke an whitewindow)
-     Die Anzahl der Quellen pro gefundener Datei -wurde bei neuen Ergebnissen nicht korrigiert.
-     Die Anzahl der gefundenen Dateien war korrekt, -jedoch die Anzahl der Quellen pro Datei entsprechend niedrig.
-- [Maj0r] Bug #306 gefixt (Danke an dsp2004)
-     Bei Partlistanfragen an einen -überlasteten Core kam es zu Fehlern.
-- [Maj0r] Fortschrittsbalken in den Splashscreen eingebaut.
-- [Maj0r] Tooltipps in der ersten Spalte der Downloadtabelle eingebaut.
-- [Maj0r] Info-Dialog geändert
-     Credits geändert.
-     Credits lassen sich nun per Mausklick in den -Dialog anhalten bzw. fortsetzen.
-

-

Version 0.56.2:
-- [Maj0r] Bug #293 gefixt (Danke an dsp2004)
-     Bei Partlistanfragen an einen -überlasteten Core kam es zu Fehlern.
-- [Maj0r] Bug #260 gefixt (Danke an computer.ist.org)
-     Buttons im Sharebereich dürfen erst -aktiviert werden, wenn die Einstellungen vom Core geholt wurden.
-- [Maj0r] Bug #282 gefixt (Danke an tnt23)
-     NullPointer behoben, der auftrat, wenn man im -Sharebereich auf "Prioritaet setzen" geklickt hat, ohne vorher einen -Eintrag zu selektieren.
-- [Maj0r] Bug #273 gefixt
-     Es kam zu einem Fehler, wenn die Partliste -nicht den gesamten reservierten Bereich bedeckte und dieser Teil von -der Maus überwandert wurde.
-- [loevenwong] Featurerequest #222 (Danke an hirsch.marcel)
-    
Combobox -zur Auswahl der letzten 3 Verbindungen -eingebaut.
-- [Maj0r] Featurerequest #222 (Danke an johannes8)
-     Download-Umbennen-Dialog bietet nun eine -Auswahl der -gefundenen Namen der Sourcen des Downloads an.
-- [Maj0r] Kontextmenü im Downloadbereich überarbeitet
-     F-Tasten eingebaut.
-     Pausieren und Fortsetzen auf vielfachen Wunsch -getrennt.
-- [Maj0r] Dialog zur Eingabe eines Datei-Incoming-Verzeichnisses kann -jetzt per <RET> bestätigt werden.
-- [Maj0r] Bug behoben, der sich durch die dynamische Generierung -der properties.xml ohne Neustart eingeschlichen hat.
-- [loevenwong] Einfügen per Kontextmenü im Download-Textfeld -eingebaut.
-- [loevenwong] Einstellungen der JGoodies werden jetzt gespeichert.
-- [Maj0r] Installierte Look&Feels werden beim Generieren der -Standard-XML mit aufgenommen.

-

Version 0.56.1:
-
-- [Maj0r] GUI startet nur noch bei unterstützter Coreversion
-    dieses GUI benötigt den Core ab Version -0.29.135.208
-- [loevenwong] GUI muss nicht neugestartet werden, wenn noch kein -Property-File vorhanden ist (wird weiterhin automatisch erzeugt).
-- [Maj0r] Featurerequest #254 gefixt (Danke an te_real_ZeroBANG)
-    Downloadtabelle wird jetzt beim Start -standarmäßig nach Dateiname sortiert.
-- [Maj0r] Featurerequest #274 gefixt (Danke an johannes8)
-    Downloads können per F2 umbenannt werden.
-- [Maj0r] Bug #264 gefixt (Danke an muhviestarr)
-     Verbindungsstatus wird richtig angezeigt.
-- [Maj0r] Modifizierbare und potenziell modifizierbare Dateien bei -Nicht-Windows-System verschoben
-    properties.xml nach ~/appleJuice/gui
-    Plugins nach ~/appleJuice/gui/plugins
-    Logs nach ~/appleJuice/gui/logs
-- [Maj0r] Pluginschnittstelle komplett überarbeitet
-    Alle vorhandenen Plugins müssen an die neue -Schnittstelle angepasst werden.
-    Gründe für die Überarbeitung:
-       1. einfacher
-       2. Eingrenzung der Plugins und -Minimierung der Fehlermöglichkeiten
-       3. Sprachdateien werden -unterstützt (zB language_xml_deutsch.xml im Plugin-Jar)
-- [Maj0r] Suchergebnisse werden nun, wenn möglich mit einem -sprechenden -Icon angezeigt.
-- [Maj0r] Suche um Filter erweitert
-    Die Filter in der Suchergebnistabelle wirken sich -NICHT auf die Suche aus, lediglich die Treffer werden gefiltert.
-- [Maj0r] Status "Warteschlange voll" wird nun auch in "In -Warteschlange" -angezeigt, da diese zB für Pwdl-Änderungen genauso relevant -sind.
-- [Maj0r] TableHeader werden in allen Tabellen gleich dargestellt.
-- [Maj0r] Unterstützung für fremde Look&Feels eingebaut
-    Um Look&Feels zu verwenden, müssen die -Themes deaktiviert werden. -   
-    Ausgeliefert werden nur JGoodies als alternative -Look&Feels.
-    Es können alle konformen Look&Feels -verwendet werden. Dazu einfach ein passendes Jar in /needed_jars legen -und die Look&Feel-Klasse in der propertes.xml eintragen.
-- [Maj0r] Unnützes Passwortfeld unter Optionen->Passwort -entfernt.
-- [Maj0r] Passwortfeld unter Optionen->Proxy ist nun wirklich ein -Passwortfeld und stellt das Passwort nicht mehr im Klartext dar.
-- [Maj0r] Standardthemepack auf Toxic geändert.
-

-

Version 0.56.0:
-meine wahrscheinlich letzte GUI für den Core 0.29.x
-
-- Soundausgabe bei korrektem Login korrigiert.
-- Sound bei fertigem Download eingebaut.
-- Unicode-Verwendung im Umgang mit den Sprachdateien korrigiert. -
-- Kleinere Korrekturen.

-

-Version 0.55.10:
-
-- Bug #246 gefixt (Danke an mail_tom62)
-     Nun können auch bei "voller" -Dateilistetabelle im Sharebereich neue Dateien hinein gezogen werden.
-     Automatische Sortierung nach Dateiname -eingebaut.
-- Featurerequest #244 gefixt (Danke an Homer1Simpson)
-    Standardmäßig ist nun beim automatischen -Powerdownload der Inaktiv-Button selektiert.
-- Bug #243 gefixt (Danke an RoadRunner)
-    GUI stört sich nicht mehr an Nicht-Themes-Zips -im Themes-Verzeichnis.
-- Bug #241 gefixt (Danke an computer.ist.org)
-    Farbgebung war genau umgekehrt. Nun gilt wirklich: -je dunkler, desto mehr Quellen gefunden.
-- Partliste zeigt nun per MausOver-Effekt den Tooltipp zum -ausgewählten Partstück an.
-

-

Version 0.55.9:
-
-- Link zur FAQ im Startbereich hinzugefügt.
-- Bug #242 gefixt (Danke an Kossi-Jaki)
-    Legende für Partliste um "aktive -Übertragung" erweitert.
-- Bug #240 gefixt (Danke an computer.ist.org)
-    Bug behoben, der im VersionChecker zu einer -NoSuchElementException führte.
-- Bug #239 gefixt (Danke an dsp2004)
-    ArrayIndexOutOfBoundsException behoben.
-- Bug #235 gefixt (Danke an Up)
-    Passwortfeld im Logindialog funktioniert wieder -ordentlich.
-

-

Version 0.55.8:
-
-- Bug #234 gefixt (Danke an hirsch.marcel)
-    Tabellen werden beim Ändern von -Spaltengrößen nicht mehr sortiert.
-- Featurerequest #228 realisiert (Danke an Major-Tom)
-    Im Pwdl-Eingabefeld funktionieren nun auch die -Hoch/Runter-Pfeiltasten.
-- Links werden nun bei Übernahme in eine verwertbare Schreibweise -geparst.
-- Bug #226 gefixt (Danke an dsp2004)
-- GUI reagiert ordentlich auf eine coreseitige Passwortänderung.
-- Server werden nun korrekt angezeigt.
-- weitere Speicheroptimierung.
-

-

Version 0.55.7:
-
- Bug #223 und #224 gefixt (Danke an dsp2004, Up und -whitewindow)
-    Das waren noch Bugs in Verbindung mit der -DOM/SAX-Umstellung..
-

-

Version 0.55.6:
-
-- meisten Teile von DOM auf SAX umgebaut
-    RAM-Verbrauch sollte dadurch spürbar gesenkt -werden.
-- Bug #219 gefixt (Danke an Up)
-    100%-CPU bei Eingabe eines falschen Passwortes beim -Anmeldedialog gefixt.
-- Bug #220 gefixt (Danke an dsp2004)
-    OutOfMemoryError behoben.
-

-

Version 0.55.5:
-
-- alten Timestampfehler beseitigt
-    Trotz Sessionumsetzung wurde immer noch der -Timestamp mitgeschleppt.
-- Bug #215 gefixt (Danke an dsp2004)
-    Partliste wird nun auch bei kleinen Dateien korrekt -gezeichnet.
-- Bug #129 gefixt (Danke an dsp2004)
-    WebsiteException durch Überlastung des Cores -sollte nun weitgehend unterbunden sein.
-

-

Version 0.55.4:
-
-- Bug #23 gefixt (Danke an computer.ist.org)
-    Suche abbrechen korrigiert.
-

-

Version 0.55.3:
-
-- Mehr Logging für WebSiteNotFoundException eingebaut.
-- Partliste bearbeitet
-    Hoffentlich den letzten Fehler behoben.
-    Anzeige der Teile, die zurzeit übertragen -werden (hellgelb bis dunkelgelb).
-    Aktualisierungintervall auf 2 Sekunden geändert.
-- Button zum Verwerfen einer abgebrochenen Suche in den Suchreiter -verschoben.
-- Link mit Quellen kann nun auch im Sharebereich erzeugt werden.
-- Bug #195 gefixt (Danke an supermuhkuh)
-    Bug bei Pwdl-Einstellung korrigiert.. -
-- Bug #167 gefixt (Danke an arnoldfake)
-    Sortierung nach Anzahl in der Suchtabelle -korrigiert. -
-- Bug #198 gefixt (Danke an froeschle567)
-    Sortierung nach Downloadstatus korrigiert.

-

Version 0.55.2:
-
-- Max. Anzahl von Quellen pro Datei kann nun begrenzt werden
-    Core ab 0.29.135.208 ist zu verwenden.
-- SplitPane in Sharebereich eingebaut.
-- Sortierung des Sharebaums verbessert.
-- Sortierung in Incoming- / Tempauswahlbaum eingebaut.
-- Partliste überarbeitet.
-- Startbereich scrollbar gemacht, wenn die Darstellung zu klein ist.
-- Rand der JSplitPane im Downloadbereich entfernt (Danke an -muhviestarr).
-- Icons für Upload-DirectStates eingebaut.
-- verwendete Java-Version wird in die Logdatei geschrieben.
-- Wizarddialog korrigiert
-    Nickname wird nun auf Richtigkeit geprüft und -gespeichert wird erst nach Durchlaufen des gesamten Wizards.
-- Bug #94 gefixt (Danke an error666)
-    Zulässige Werte für Core-Port und XML-Port -sind 1024<x<=32000.
-- Bug #185 gefixt (Danke an muhviestarr)
-    Einstellungen des GUIs werden beim Schliessen des -Core gesichert.
-- Downloadlinks können optional mit der eigenen Quelle und ggf. -mit dem verbundenen Server in die Ablage kopiert werden.
-- Serverlinks können in die Ablage kopiert werden.
-

-

Version 0.55.1:
-
-- Kommunikation mit dem Core erfolgt nun komprimiert
-    Core ab Version 0.29.133.201 ist zu verwenden.
-    Ich steuer den Core meist mit dem GUI über das -Internet und konnte eine mehr als deutliche -Geschwindigkeitsverbesserung festellen.
-

-

Version 0.54.7:
-
-- AutomaticPowerdownloadPolicies können nun von Benutzern mit -Java-Erfahrung selbst implementiert werden
-    Dazu muss die Klasse AutomaticPowerdownloadPolicy -abgeleitet und ein Jar gebaut werden.
-    Zum Bauen des jar-Archivs gibt es ein neues Target -in der build.xml.
-    Das GUI erwartet diese Jars im Unterordner -/pwdlpolicies.
-- "Verbindung zum Core verloren" sollte nicht mehr so schnell -kommen (Danke an the_Killerbee).
-- Interne Umbauten um Objekte zu sparen
-    Alle Plugins, die auf globale Objekte mittels -MapSetStringKey zugreifen, müssen angepasst werden, sind in ihrer -alten Version nicht mehr lauffähig und führen zu -ClassNotFoundExceptions im Log.
-    Anstatt eines "new MapSetStringKey(String)" reicht -nun dieser String oder ein "Integer.toString(int)" bei IDs.
-    Die Klasse MapSetStringKey wurde restlos entfernt.
-- Logging verbessert
-    main() in eigene ThreadGroup gepackt, dadurch kann -keine Exception mehr "durchrasseln", alle Exceptions finden sich im Log.
-

-

Version 0.54.6:
-
Nur Frische Bugs beseitigt
-- Bug #155 gefixt (Danke an daa803)
-    Sharebaum wird nun wieder korrekt dargestellt.
-- Bug #154 gefixt (Danke an hirsch.marcel)
-    Alte Objekte werden jetzt wieder korrekt entfernt.
-- Bug #160 gefixt (Danke an octron80)
-    Fertige oder abgebrochene Downloads können nun -wieder entfernt werden.
-- Bug #153 umgesetzt (Danke an jr17)
-    Verbindungsdialog kann nun per Option beim -nächsten GUI-Start erzwungen werden.
-
-Version 0.54.5:
-
- Filter beim Start des GUI eingebaut
-    Die Quellen werden beim ersten Holen der Daten vom -Core nicht abgefragt, so dass Downloads sehr schnell gezeigt werden -können.
-    Nachteil: Da die Quellen anfangs fehlen, stehen die -Geschwindigkeiten aller Downloads auf 0 kb/s. Die Gesamtgeschwindigkeit -wird jedoch angezeigt.
-    Das lange Laden aufgrund von vielen Quellen wird so -folglich nur verschoben und der Benutzer bekommt früh erste -Informationen zu sehen.
-- Icons für Netware und OS/2 eingefügt.
-- Wiederholtes, zeitintensives Laden der gesamten Infos sollte nun -durch ein überarbeitetes Sessionmanagement unterbunden sein.
-- Fehlerhafte Anzeige von Menütexten bei Nicht-Windows-Systemen -gefixt.
-

-

Version 0.54.4:
-
-- Kontextmenüs mit Icons ausgestattet.
-- Optionenmenü überarbeitet.
-- An neue Coreschnittstelle angepasst.
-- TrayIcon-Bug hoffentlich behoben.
-

-

Version 0.54.3:
-
-- Reihenfolge der Spalten der Download- und Uploadtabelle wird -gespeichert
-     Da die properties.xml angefasst werden musste, -wird diese beim ersten Start neu generiert.
-- Bug #74 gefixt (Danke an habkeineMail)
-- ajl-Listen können nun über das Menü importiert werden.
-- Sprachdatei "türkisch" eingebaut (Danke an nurseppel).
-- Upload-Fortschrittsanzeige wird jetzt nur noch bei aktiven Uploads -angezeigt.
-- Laden von Plugins verbessert.
-     Müll oder nicht standardkonforme Plugins -im Plugin-Ordner werden nun korrekt behandelt.
-- Bug #98 gefixt (Danke an twix)
-
-Version 0.54.2:
-
-- Bug #91 umgesetzt (Danke an hirsch.marcel)
-     Maxupload- und Maxdownloadgeschwindigkeit kann -nun über das TrayIcon eingestellt werden (Windowsversion).
-- Bug #82 gefixt (Danke an hirsch.marcel)
-     Sortierung von Downloads innerhalb von -Unterverzeichnissen der Downloadtabelle korrigiert.
-- Sortierung in die Suchergebnistabelle eingebaut.
-- Bug #92 gefixt (Danke an daa803)
-- Bug #77 gefixt (Danke an spam_blocker)
-     Selektionsproblem der Downloadtabelle beim -Entfernen von fertigen Downloads behoben.
-- Tabellenspalten der Download- und Uploadtabelle können nun -über ein -Kontextmenü bei Rechtsklick auf den Tabellenheader -aus/eingeblendet -werden.
-- Im Downloadbereich sind nun der obere (Tabelle) und der untere -Bereich (Powerdownload, Partliste) in der Höhe verstellbar.
-- Bug #83 gefixt (Danke an hirsch.marcel)
-     Tabellenspalten können nun korrekt -verschoben werden..
-- Bug #33 gefixt (Danke an oz_2k)
-     Obwohl ich denke, dass es sich um ein Feature -der Themes handelt, wurde der Vollbildmodus auf Wunsch vieler Benutzer -an Windowsstandard angepasst.
-

-

Version 0.54.1:
-
- Bug #53 gefixt (Danke an o_a_s_e_)
-     98%-CPU-Last Bug durch Suche gefixt.
-- Warnmeldung bezüglich 30-Minuten-Sperre bei manuellem -Serverwechsel eingebaut.
-- Bug #63 umgesetzt (Danke an clickweg)
-     Den Link zum Holen von Servern in einen Button -umgebaut, da der Link wohl von vielen übersehen wurde.
-- Bug #23 gefixt (Danke an computer.ist.org)
-     Suche lässt sich nun korrekt abrechen.
-
-
Version 0.53.2:
-
- Bug #67 gefixt (Danke an dsp2004)
-     Probleme mit der Funktion automatisch -Partliste anzeigen korrigiert.
-

-

Version 0.53.1:
-
-- Wenn die Verbindung zum Core aufgrund von Überlastung des Core -abreisst, wird 2x erneut probiert, bevor das GUI beendet wird.
-- TrayIcon für Windowsplattformen eingebaut
-- Bug #56 gefixt (Danke an MeineR)
-    Das Laden der Plugins beim Start kann über das -Optionenmenü deaktiviert werden.
-- Bug #43 gefixt (Danke an flabeg)
-    Shareverzeichnis wird bei -Prioritätenänderung nicht mehr komplett neu geladen, sondern -nur aktualsiert.
-- Bug #13 umgesetzt (Danke an HabkeineMail)
-    Powerdownload-Werte werden jetzt bei Klick auf einen -Download / Quelle im Powerdownloadfeld angezeigt.
-- Bug #42 umgesetzt (Danke an dsp2004)
-    Partlisten werden nun durch eine Option wahlweise -bei Mausklick auf den Download / Quelle oder über den Button -"Partliste anzeigen" geholt.
-- properties.xml aus den Download-Archiven entfernt
-    Beim Update auf eine neuere Version muss diese nun -nur noch bei einer Formatänderung erneuert werden.
-    Nachteil: Bei einer kompletten Neuinstallation -erhält man beim ersten Start eine Fehlermeldung und muss das GUI -neu starten.
-- Wenn eine neue Version gefunden wird, kann diese nun direkt mit dem -Standardbrowser herunter geladen werden
-    Der Standardbrowser muss in den Optionen -ausgewählt werden.
-- Links im Startbereich sind jetzt anklickbar, sofern ein -Standardbrowser ausgewählt ist.
-- Bug #40 umgesetzt (Danke an hirsch.marcel)
-    Incoming-Verzeichnis kann nun für mehrere -Downloads gleichzeitig geändert werden.
-- PluginOptionenDialog überarbeitet.
-- Dialog bei fehlgeschlagenem Verbindungsversuch überarbeitet.
-- Menüpunkt zum Beenden des Core auf vielfachen Wunsch an separate -Stelle verschoben.
-- Bug #17 gefixt (Danke an HabkeineMail)
-    Partlisten von einigen wenigen DownloadSourcen -wurden bei Bedarf nicht geholt.
-- sonstige Kleinigkeiten.
-

-

Version 0.52.1:
-
-- Plugin-Entwickler können nun ein JPanel für Optionen -implementieren, welches ggf. im Plugin-Reiter der Optionen aufgerufen -werden kann..
-- Plugin-Entwickler können nun Objekte direkt mittels ID vom Core -erfragen (Danke an webhamster).
-- Bug #19 gefixt (Danke an dsp2004)
-    Nullpointer behoben.
-

-

Version 0.51.2:
-
-- Bug #14 umgesetzt (Danke an Dragonne)
-    Es konnte zu einem Fehler kommen, wenn gleichzeitig -zwei Instanzen des GUIs liefen.
-- Der Core kann jetzt übers GUI beendet werden.
-- Downloads können nun umbenannt werden.
-- Das Zielverzeichnis für einen Download -(Incoming-Unterverzeichnis) kann nun geändert werden.
-- Überprüfung auf gültige Javaversion eingebaut
-    Es wird mindestens 1.4 benötigt (empfohlen -1.4.2).
-- Suchanzeige korrigiert
-    Es kann passieren, dass nicht alle gefundenen -Suchergebnisse beim Core ankommen, die Ausgabe wurde entsprechend -korrigiert.
-- Bug #8 umgesetzt (Danke an finn)
-    Downloadlinks kann man nun auch direkt in der -Downloadtabelle per Kontexmenü erzeugen.
-    Ich wollte es eigentlich nicht umsetzen, da ich die -Funktion an dieser Stelle für falsch platziert erachte, doch da -der Wunsch bei vielen Benutzern bestand, hab ich es nun doch eingebaut.
-    In die Uploadtabelle werde ich es definitiv NICHT -einbauen.
-- Bug #10 fixed (Danke an muhviestarr)
-    Wenn man keine Downloads hat, steht nun nicht mehr -"bitte warten" in der Downloadtabelle.
-

-

Version 0.51.1:
-
-- Downloadlinks werden jetzt in ISO-8859-1 an den Core übertragen.
-- Versionupdateinformation geändert
-    Über die Optionen kann nun gewählt werden, -ob man nur bei neuen Versionen (0.51.1), -wichtigen Änderungen (0.51.1) -oder sogar bei kosmetischen Korrekturen (0.51.1) benachrichtigt wird.
-    Standard ist Benachrichtigung bei wichtigen -Änderungen.
-- Bug #1 fixed (Danke an muhviestarr)
-    Look & Feel stimmt nun auch beim -Verbindungsdialog.
-- Bug #2 fixed (Danke an muhviestarr)
-    Taskbareintrag für den Splashscreen und den -Verbindungsdialog eingebaut.
-- Bug #4 fixed (Danke an muhviestarr)
-    Shareanzeige bei Prioritaetenaenderung -gefixt.
-- Dateigrößen in der Sharetabelle -werden nun korrekt ausgegeben (Danke an schnigger und TuxHomer).
-- Nullpointer behoben der auftrat, wenn der -verbundene Server keinen Namen hat (Danke an paderborner).
-

-

Version 0.50:
-
-- Logging kann nun komplett deaktiviert werden (Danke an muhviestarr).
-- Im Verbindungsfenster geht nun ein einfaches -<Enter> (Danke an muhviestarr).
-- Legende für die Servertabelle eingebaut (Danke an muhviestarr).
-- Text von Netzwerk, Neuigkeiten und Nachrichten -ist nun auch schwarz (Danke an muhviestarr).
-- Die Überschrift "Warnungen" auf der -Startseite wird nun ausgeblendet, wenn es keine Warnungen gibt (Danke -an muhviestarr).
-- Gridlines werden nun in der Servertabelle nicht mehr -angezeigt (Danke an muhviestarr).
-- Splashscreen wird nun früher angezeigt (Danke an muhviestarr).
-- Bug in der Partliste behoben.
-- Dau-Button zum Anzeigen der Partliste eingebaut.
-- Bug der Tableheader der Share- und der Uploadtabelle behoben (Danke -an muhviestarr).
-

-

Version 0.49:
-
-- Bug bei der Wiedergabe von Sounds korrigiert (Danke an mrbond).
-    Sounddevice wird nun nach Ausgabe eines Sounds -wieder freigegeben.
-- Es kann nun der Link einer gesharten Datei über das -Popupmenü der Sharetabelle als UBB-Code in die Ablage kopiert -werden.
-- Entwicklercreditsanzeige im Infodialog korrigiert.
-- Bug im Sharebaum behoben.
-- Bug beim Sortieren der Sharetabelle behoben.
-

-

Version 0.48:
-
- Initialen Aufruf des Sharetabs durch einen Initialisierungsthread -beschleunigt.
-- In der Downloadtabelle nun ein Warteicon angezeigt, bis erstmalig -Daten geholt wurden.
-- Verhalten des Popupmenüs der Servertabelle überarbeitet.
-- Partliste wird nun nur noch über das PopupMenü geholt.
-    Wenn der Downloadtab verlassen wird, wird das -Aktualisieren der aktuellen Partliste beendet.
-

-

Version 0.47:
-
- Sharetabelle auf vielfachen Wunsch komplett überarbeitet.
-- Partliste wird erst nach 2 Sekunden Wartezeit geholt (Danke an -muhviestarr).
-    Wenn innerhalb dieser Zeit auf einen anderen -Download.bzw. eine andere Quelle geklickt wird, wird die Wartezeit neu -gestartet.
-- Suche kann nun GUI-seitig abgebrochen werden.
-    Der aktuelle Core (0.29.124.1215) hat an dieser -Stelle noch einen Bug, eine Suche wird jedoch nach einiger Zeit -automatisch beendet.
-- Tabellenspaltenroothandles werden nun in der Downloadtabelle -angezeigt (Danke an muhviestarr).
-    So weiss auch der letzte Benutzer, dass man auf -einen Download klicken kann, um die Quellen zu finden.
-- Neuen Downloadstatus "Fehler beim Fertigstellen" und neuen -Quellenstatus "Eigenes Limit erreicht" eingebaut.
-- Rundungsfehler beim automatischen Powerdownload behoben (Danke an -garnichda).
-

-

Version 0.46:
-
- Bug beim autom. Pwdl behoben, der auftrat, wenn nur eine Datei im -Download war.
-- Bug im Menü behoben, Auswahl eines Menüpunktes geht nun -gewohnt schnell..
-- Kleinere optische Korrekturen (Danke an DBZfan)
-    z.B. Hintergrundfarben aller Scrollbereiche an ihre -Tabelle angepasst.
-- Prozentangabe bei Downloads nun auf zwei Nachkommastellen genau -(Danke an muhviestarr)
-- Parameterübergabe an das GUI geändert
-    Mögliche Parameter können per -help -angezeigt werden.
-    Die reg-Datei muss neu angepasst und importiert -werden, da diese ebenfalls modifiziert werden musste.
-- diverse andere Bugs behoben
-

-

Version 0.45:
-
- Links können nun an das GUI übermittelt werden -(für den INet-Explorer muss die entsprechende reg-Datei angepasst -und importiert und die Windows-Exe verwendet werden).
-- Themes sind nun deaktivierbar

-

Version 0.44:
-
- Themes eingebaut (Danke an LinuxDoc)
-    Passende Themes gibt’s -auf http://javootoo.l2fprod.com/plaf/skinlf/index.php.
-- Automatischen Powerdownload eingebaut
-    Verschiedene Arten des autom. Pwdls können in -Zukunft durch selbst implementierte Klassen per Combobox -ausgewählt werden (nächste Version).
-

-

Version 0.43:
-
- max.RAM-Anzeige in Memory-Monitor eingebaut (Anzeige oben links -nun -"reserviert / max allocated").
-- Soundicons optisch korrigiert.
-- Fehler bei der Soundausgabe bei fehlerhaften Sounddateien (z.B. -falsches -Format) oder fehlendem Sounddevice behoben.

-

Version 0.42:
-
- Memory-Monitor eingebaut (ja, die Anzeige geht richtig und zeigt -den -echten RAM-Verbrauch der Anwendung).
-- manuellen GarbageCollector bei jeder 30. Aktualisierung eingebaut.

-

Version 0.41:
-
- Fehler im Pwdl-Textfeld behoben.
-
- Sortieren der Downloadtabelle nach Status eingefügt.
-
- Speicheroptimierungen.

-

Version 0.40:
-
- Soundeffekte für diverse Ereignisse eingefügt.
-
-Version 0.39:
-
- Standarduploadpriorität ist im Core -noch nicht implementiert und deshalb erstmal wieder aus dem GUI -geflogen (Danke an xcalibur).
-- Buttons zum Ändern der Pwdl-Werte -entsprechend dem Standard vertauscht (Danke an lova).
-- Baum zur Auswahl des Temp- und Incomingordners -korrigiert. Bug hat -sich erst mit v0.38 -eingeschlichen (Danke an lova und akku).

-
-IRC-Plugin
-
-
-
-Version 1.35:
-- [Maj0r] Bug #523 gefixt (Danke an Up)
-     Darstellung von Actions und Notices korrigiert.
-
-Version 1.34:
-
-GUI ab Version 0.61.0 -wird benötigt
-- [Maj0r] Featurerequest #415 (Danke an Up)
-     Links können angeklickt werden.
-- [Maj0r] Userliste wird nun mit Icons für den Userstatus dargestellt.
-- [Maj0r] Bug #416 gefixt (Danke an Up)
-     Verwendung der Userstati korrigiert.
-- [Maj0r] Bug #434 gefixt (Danke an dsp2004)
-
-Version 1.33:
-
- [loevenwong & Maj0r] neues Feature
-     Per /ajstats und /ajversinfo können -aktuelle Verbindungsinfos im Channel ausgegeben werden (alle 60 -Sekunden).
-     /ajoptionsinfo kann nur per Query -ausgeführt werden (soll den Support erleichtern) und gibt die -wesentlichen Einstellungen des Cores aus.
-     Spamming und unaufgeforderte Skriptverwendung -werden in #applejuice mit Kick bestraft!
-

Version 1.32:
-
- [Maj0r] Bug #399 gefixt (Danke an Up)
-     Notices werden jetzt magenta im Channel -angezeigt.
-- [Maj0r] Bug #389 gefixt (Danke an panterfrau)
-- [Maj0r] Bug #391 gefixt (Danke an panterfrau)
-- [Maj0r] Bug #395 gefixt
-     Kein echter Fix, da ich aus dem Log nicht -ersehen kann, was passiert.
-     Ich habe es so umgebaut, dass dieser Fehler im -Channel blau dargestellt wird und nicht mehr stört.
-
-Version 1.31:
-
-- Diverse Verbesserungen.
-- Standardplugin ab GUI 0.58.0
-

-

Version 1.1:
-
-- Plugin an neue ID-Verwendung im GUI angepasst. Voraussetzung ist GUI -ab 0.54.7
-

-

Version 1.0:
-
-- Erstes Release.
-

-
- - - diff --git a/AJClientGUI/classes/de/applejuicenet/client/shared/MultiLineToolTip$1.class b/AJClientGUI/classes/de/applejuicenet/client/shared/MultiLineToolTip$1.class deleted file mode 100644 index b153437a..00000000 Binary files a/AJClientGUI/classes/de/applejuicenet/client/shared/MultiLineToolTip$1.class and /dev/null differ diff --git a/AJClientGUI/icons/applejuice.gif b/AJClientGUI/icons/applejuice.gif deleted file mode 100644 index 431ab074..00000000 Binary files a/AJClientGUI/icons/applejuice.gif and /dev/null differ diff --git a/AJClientGUI/logs/.cvsignore b/AJClientGUI/logs/.cvsignore deleted file mode 100644 index 2d19fc76..00000000 --- a/AJClientGUI/logs/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.html diff --git a/AJClientGUI/needed_jars/TableLayout-20050920.jar b/AJClientGUI/needed_jars/TableLayout-20050920.jar deleted file mode 100644 index 81c1fc3c..00000000 Binary files a/AJClientGUI/needed_jars/TableLayout-20050920.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/ajcorefassade.jar b/AJClientGUI/needed_jars/ajcorefassade.jar deleted file mode 100644 index 6f6f2792..00000000 Binary files a/AJClientGUI/needed_jars/ajcorefassade.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/ajtray.jar b/AJClientGUI/needed_jars/ajtray.jar deleted file mode 100644 index 95dae56a..00000000 Binary files a/AJClientGUI/needed_jars/ajtray.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/log4j-1.2.15.jar b/AJClientGUI/needed_jars/log4j-1.2.15.jar deleted file mode 100644 index c930a6ab..00000000 Binary files a/AJClientGUI/needed_jars/log4j-1.2.15.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/looks-2.2.1.jar b/AJClientGUI/needed_jars/looks-2.2.1.jar deleted file mode 100644 index 199b267d..00000000 Binary files a/AJClientGUI/needed_jars/looks-2.2.1.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/skinlf.jar b/AJClientGUI/needed_jars/skinlf.jar deleted file mode 100644 index 6d991c4d..00000000 Binary files a/AJClientGUI/needed_jars/skinlf.jar and /dev/null differ diff --git a/AJClientGUI/needed_jars/tklcontrols.jar b/AJClientGUI/needed_jars/tklcontrols.jar deleted file mode 100644 index e940ee85..00000000 Binary files a/AJClientGUI/needed_jars/tklcontrols.jar and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_blue.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_blue.gif deleted file mode 100644 index bbb7f6d8..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_blue.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_chan.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_chan.gif deleted file mode 100644 index fb87f879..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_chan.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_green.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_green.gif deleted file mode 100644 index e443a544..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_green.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_login.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_login.gif deleted file mode 100644 index bf2caa7d..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_login.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_red.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_red.gif deleted file mode 100644 index 88b57b7d..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_red.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/icons/irc_yellow.gif b/AJClientGUI/plugin_src/ircplugin/icons/irc_yellow.gif deleted file mode 100644 index a00fa88c..00000000 Binary files a/AJClientGUI/plugin_src/ircplugin/icons/irc_yellow.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/ircplugin/language_deutsch.properties b/AJClientGUI/plugin_src/ircplugin/language_deutsch.properties deleted file mode 100644 index 1e1b409e..00000000 --- a/AJClientGUI/plugin_src/ircplugin/language_deutsch.properties +++ /dev/null @@ -1,14 +0,0 @@ -language=deutsch -language.description=Der IRC-Client dient zum Kontakt zur appleJuce-Gemeinschaft und zur Supportvereinfachung. Es wird nur der Server des offiziellen appleJuice-Kanals #applejuice untersttzt. Der Klient untersttzt das Besuchen mehrerer Rume, Queries, usw. Ben?tigt wird ein GUI ab 0.70.4 -language.buttons.connect=Verbinden -language.buttons.disconnect=Trennen -language.buttons.private=Privat sprechen -language.buttons.join=Raum besuchen -language.buttons.nick=Nick ndern -language.buttons.info=Nick Info -language.buttons.cancel=Abbrechen -language.channel.newchannel=Raumnamen eingeben -language.nick.newnick=Nickname -language.title.newconnection=Verbindungsinfo -language.disablerules=Chanregeln anzeigen deaktivieren -language.channel.gesamt=Gesamt diff --git a/AJClientGUI/plugin_src/ircplugin/language_english.properties b/AJClientGUI/plugin_src/ircplugin/language_english.properties deleted file mode 100644 index 95acae5e..00000000 --- a/AJClientGUI/plugin_src/ircplugin/language_english.properties +++ /dev/null @@ -1,14 +0,0 @@ -language=english -language.description=This irc-client supports multiple rooms, queries and much more. GUI 0.70.2 or higher is needed. -language.buttons.connect=Connect -language.buttons.disconnect=Disconnect -language.buttons.private=Talk Private -language.buttons.join=Join a channel -language.buttons.nick=Change nick -language.buttons.info=Nick Info -language.buttons.cancel=Cancel -language.channel.newchannel=Enter channel name -language.nick.newnick=Nickname -language.title.newconnection=Connection Info -language.disablerules=Disable chanrules -language.channel.gesamt=Entire diff --git a/AJClientGUI/plugin_src/ircplugin/plugin.properties b/AJClientGUI/plugin_src/ircplugin/plugin.properties deleted file mode 100644 index c1e53936..00000000 --- a/AJClientGUI/plugin_src/ircplugin/plugin.properties +++ /dev/null @@ -1,7 +0,0 @@ -general.title=ajIRC -general.version=1.38 -general.author=Maj0r -general.contact=tkrall@tkl-soft.de -general.description=Der IRC-Client dient zum Kontakt zur appleJuce-Gemeinschaft und zur Supportvereinfachung. Es wird nur der Server des offiziellen appleJuice-Kanals #applejuice untersttzt. Der Klient untersttzt das Besuchen mehrerer Rume, Queries, usw. Bentigt wird ein GUI ab 0.70.4 -general.istab=true -general.classname=de.applejuicenet.client.gui.plugins.ircplugin.IrcPlugin \ No newline at end of file diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/ChannelPanel.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/ChannelPanel.java deleted file mode 100644 index 37a47265..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/ChannelPanel.java +++ /dev/null @@ -1,1034 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.AWTKeyStroke; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.KeyboardFocusManager; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import java.net.URL; - -import java.text.SimpleDateFormat; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.ListSelectionModel; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.MutableAttributeSet; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyledDocument; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.AppleJuiceClient; -import de.applejuicenet.client.fassade.ApplejuiceFassade; -import de.applejuicenet.client.fassade.entity.Information; -import de.applejuicenet.client.fassade.entity.Server; -import de.applejuicenet.client.fassade.exception.IllegalArgumentException; -import de.applejuicenet.client.fassade.shared.AJSettings; -import de.applejuicenet.client.gui.AppleJuiceDialog; -import de.applejuicenet.client.gui.start.HyperlinkAdapter; - -/** - * $Header: - * /cvsroot/applejuicejava/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/ChannelPanel.java,v - * 1.18 2004/12/06 20:55:30 maj0r Exp $ - * - *

- * Titel: AppleJuice Client-GUI - *

- *

- * Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten - * appleJuice-Core - *

- *

- * Copyright: General Public License - *

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class ChannelPanel extends JPanel implements ActionListener -{ - public static final String HTTP_IDENTIFIER = "http://"; - public static final String WWW_IDENTIFIER = "www."; - private static final Color JOIN_GREEN = new Color(0, 128, 0); - private String name; - private SortedListModel usernameList = new SortedListModel(); - private JList userList = new JList(usernameList); - private JTextPane textArea = new JTextPane(); - private StyledDocument document = (StyledDocument) textArea.getStyledDocument(); - private JTextField textField; - private SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss"); - private ArrayList befehle = new ArrayList(); - private int befehlPos = -1; - private JLabel counter = new JLabel("0 Ops, 0 Gesamt"); - private JTextPane titleArea = new JTextPane(); - private JButton closeButton = new JButton("X"); - private XdccIrc parentPanel; - private boolean selected = false; - private boolean marked = false; - private JTabbedPane tabbedPane; - private Logger logger; - private long lastStatsPrinted = 0; - private long lastVersionPrinted = 0; - private String counterText = "Gesamt"; - - public ChannelPanel(XdccIrc parentPanel, String name, JTabbedPane tabbedPane) - { - logger = Logger.getLogger(getClass()); - this.name = name; - this.parentPanel = parentPanel; - this.tabbedPane = tabbedPane; - makePanel(); - } - - public SortedListModel getUserNameList() - { - return usernameList; - } - - public void selected() - { - selected = true; - marked = false; - } - - public void unselected() - { - selected = false; - } - - private void makePanel() - { - setLayout(new BorderLayout()); - textArea.setEditorKit(new LinkEditorKit()); - textArea.setDocument(document); - textArea.setEditable(false); - textArea.addHyperlinkListener(new HyperlinkAdapter(textArea)); - textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - textArea.setBackground(Color.WHITE); - textField = new JTextField(); - Set set = new HashSet(1); - - set.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_JAPANESE_HIRAGANA, 0)); - textField.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set); - textField.addActionListener(this); - textArea.addKeyListener(new KeyAdapter() - { - public void keyTyped(KeyEvent ke) - { - textField.setText(textField.getText() + ke.getKeyChar()); - textField.requestFocus(); - } - }); - textField.addKeyListener(new KeyAdapter() - { - public void keyReleased(KeyEvent ke) - { - super.keyReleased(ke); - if(ke.getKeyCode() == KeyEvent.VK_TAB) - { - String text = textField.getText(); - - if(text.length() > 0) - { - int index = text.lastIndexOf(' '); - int index2 = text.lastIndexOf(','); - - if(index2 > index) - { - index = index2; - } - - String searchString; - - if(index != -1) - { - searchString = text.substring(index + 1).toLowerCase(); - } - else - { - searchString = text.toLowerCase(); - } - - String treffer = ""; - int count = 0; - - synchronized(usernameList) - { - User[] users = usernameList.getValues(); - String compareValue; - - for(int i = 0; i < users.length; i++) - { - if(users[i].getName().toLowerCase().startsWith(searchString)) - { - treffer += users[i].getName() + " "; - count++; - } - } - } - - if(treffer.length() > 0) - { - treffer = treffer.substring(0, treffer.length() - 1); - if(count == 1) - { - if(index != -1) - { - String newText = text.subSequence(0, index + 1) + treffer; - - textField.setText(newText); - } - else - { - textField.setText(treffer); - } - } - else if(count > 1) - { - updateTextArea("\t" + treffer, false); - } - } - } - } - else if(befehlPos != -1) - { - if(ke.getKeyCode() == KeyEvent.VK_UP) - { - textField.setText(befehle.get(befehlPos)); - if(befehlPos > 0) - { - befehlPos--; - } - } - else if(ke.getKeyCode() == KeyEvent.VK_DOWN) - { - if(befehlPos < befehle.size() - 1) - { - befehlPos++; - } - - textField.setText(befehle.get(befehlPos)); - } - } - } - }); - - userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - userList.addMouseListener(new MouseAdapter() - { - public void mouseClicked(MouseEvent me) - { - if(me.getClickCount() == 2) - { - User user = (User) userList.getSelectedValue(); - - if(!user.getName().equalsIgnoreCase(parentPanel.getNickname())) - { - JTabbedPane tabbedPane = parentPanel.getTabbedPane(); - - for(int i = 1; i < tabbedPane.getTabCount(); i++) - { - if(tabbedPane.getTitleAt(i).equalsIgnoreCase(user.getName())) - { - return; - } - } - - parentPanel.addUser(tabbedPane, user.getName()); - tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1); - } - } - } - }); - userList.setCellRenderer(new UserListCellRenderer()); - - JScrollPane sp1 = new JScrollPane(textArea); - JScrollPane sp2 = new JScrollPane(userList); - JPanel panel1 = new JPanel(new BorderLayout()); - - panel1.add(counter, BorderLayout.NORTH); - panel1.add(sp2, BorderLayout.CENTER); - - sp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - sp2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp1, panel1); - - splitPane.setDividerLocation(AppleJuiceDialog.getApp().getSize().width - 200); - add(splitPane, BorderLayout.CENTER); - add(textField, BorderLayout.SOUTH); - add(makeNorth(), BorderLayout.NORTH); - } - - private Box makeNorth() - { - Box northBox = Box.createHorizontalBox(); - - // let's add actions - closeButton.addActionListener(this); - - northBox.add(closeButton); - titleArea.setEditable(false); - northBox.add(titleArea); - - return northBox; - } - - private MutableAttributeSet setLink(String sUrl, SimpleAttributeSet attributeSet) - { - MutableAttributeSet a = new SimpleAttributeSet(attributeSet); - - try - { - if(!sUrl.toLowerCase().startsWith(ChannelPanel.HTTP_IDENTIFIER)) - { - sUrl = ChannelPanel.HTTP_IDENTIFIER + sUrl; - } - - URL url = new URL(sUrl); - - a.addAttribute(LinkEditorKit.LINK, new URL(sUrl)); - } - catch(Exception e) - { - - // nothing to do - } - - a.addAttribute(StyleConstants.Bold, Boolean.TRUE); - a.addAttribute(StyleConstants.Underline, Boolean.TRUE); - return a; - } - - public void actionPerformed(ActionEvent e) - { - Object source = e.getSource(); - - // let's take care of textField - if(source == textField) - { - String message = textField.getText(); - - if(message.length() > 450) - { - message = message.substring(0, 450); - } - - // let's send to server - if(message.startsWith("/")) - { - - // commands that start with "/" - // message = message.substring(1); - if(message.toLowerCase().compareTo("/ajstats") == 0 || message.toLowerCase().compareTo("/ajversinfo") == 0) - { - long currentTime = System.currentTimeMillis(); - - if(message.toLowerCase().compareTo("/ajstats") == 0) - { - if(currentTime > lastStatsPrinted + 60000) - { - lastStatsPrinted = currentTime; - ApplejuiceFassade ajFassade = AppleJuiceClient.getAjFassade(); - Information info = ajFassade.getInformation(); - StringBuffer buf = new StringBuffer(); - - String coreVersion = AppleJuiceClient.getAjFassade().getCoreVersion().getVersion(); - String guiVersion = AppleJuiceDialog.GUI_VERSION; - String ircPluginVersion = parentPanel.getPlugin() - .getGeneralXMLAttributeByTagName(".root.general.version.value"); - - String version = "Java-GUI: " + guiVersion + " / Core: " + coreVersion + " / IRC-Plugin: " + ircPluginVersion; - - buf.append(version + " | "); - String verbindungstatus = null; - - switch(info.getVerbindungsStatus()) - { - - case Information.VERBUNDEN: - { - int serverId = ajFassade.getNetworkInfo().getConnectedWithServerId(); - - try - { - Server curServer = (Server) ajFassade.getObjectById(serverId); - - verbindungstatus = "Server: " + curServer.getName(); - } - catch(IllegalArgumentException e1) - { - verbindungstatus = "Verbindung: verbunden"; - } - - break; - } - - case Information.NICHT_VERBUNDEN: - { - verbindungstatus = "Verbindung: nicht verbunden"; - break; - } - - case Information.VERSUCHE_ZU_VERBINDEN: - { - verbindungstatus = "Verbindung: versuche zu verbinden"; - break; - } - } - - if(null != verbindungstatus) - { - buf.append(verbindungstatus + " | "); - } - - buf.append("Aktueller DL:" + info.getUpDownAsString() + " | "); - buf.append("Gesamt-DL:" + info.getUpDownSessionAsString() + " |"); - buf.append(info.getCreditsAsString() + " | "); - buf.append("offene Verbindungen: " + info.getOpenConnections() + " | "); - - AJSettings ajSettings = ajFassade.getCurrentAJSettings(); - - buf.append("erlaubte Verbindungen: " + ajSettings.getMaxConnections() + " | "); - buf.append("max. neue Verbindungen/10 Seks: " + ajSettings.getMaxNewConnectionsPerTurn() + " | "); - buf.append("max. DL: " + ajSettings.getMaxDownloadInKB() + " KB/s | "); - buf.append("max. UP: " + ajSettings.getMaxUploadInKB() + " KB/s | "); - buf.append("max. Quellen/Datei: " + ajSettings.getMaxSourcesPerFile() + " | "); - buf.append("max. KB/Uploadslot: " + ajSettings.getSpeedPerSlot() + " KB/s"); - - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + buf.toString()); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + buf.toString()); - } - } - else if(message.toLowerCase().compareTo("/ajversinfo") == 0) - { - if(currentTime > lastVersionPrinted + 60000) - { - lastVersionPrinted = currentTime; - String coreVersion = AppleJuiceClient.getAjFassade().getCoreVersion().getVersion(); - String guiVersion = AppleJuiceDialog.GUI_VERSION; - String text = "Java-GUI: " + guiVersion + " / Core: " + coreVersion; - - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + text); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + text); - } - } - } - else - { - parentPanel.analyzeCommand(message); - } - - textField.setText(""); - } - else - { - // A private message to channel! - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + message); - - // let's update textArea - // textArea.append(textField.getText() + "\n"); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + textField.getText()); - textField.setText(""); - } - - if(message != null && message.length() > 0) - { - befehle.add(message); - if(befehle.size() > 40) - { - befehle.remove(0); - } - - befehlPos = befehle.size() - 1; - } - } - else if(source == closeButton) - { - parentPanel.closeChannel(parentPanel.getTabbedPane(), name); - - // Let's send a sensible message - parentPanel.parseSendToCommand("PART " + name); - } - } - - public void setTitleArea(String title) - { - StyledDocument doc = titleArea.getStyledDocument(); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - - StyleConstants.setBackground(attributes, Color.WHITE); - try - { - doc.remove(0, doc.getLength()); - int startIndex = 0; - - for(int i = 0; i < title.length(); i++) - { - if(title.charAt(i) == 3 || i == title.length() - 1) - { - if(title.charAt(i) == 3) - { - String toWrite = title.substring(startIndex, i); - - if(toWrite.length() > 0) - { - attributes = writeString(doc, attributes, toWrite); - } - - startIndex = i + 1; - i++; - } - else - { - String toWrite = title.substring(startIndex); - - if(toWrite.length() > 0) - { - attributes = writeString(doc, attributes, toWrite); - } - } - } - } - } - catch(BadLocationException ex) - { - ex.printStackTrace(); - } - } - - private SimpleAttributeSet writeString(StyledDocument doc, SimpleAttributeSet attributes, String toWrite) - { - boolean istNachkomma = false; - boolean parsEnde = false; - int index = 0; - - if(toWrite.length() > 1) - { - while(!parsEnde) - { - try - { - if(toWrite.charAt(index) == ',') - { - istNachkomma = true; - index++; - continue; - } - - int colorCode = Integer.parseInt(toWrite.substring(index, index + 2)); - - index += 2; - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE) - { - if(toWrite.charAt(index + 1) != ',') - { - parsEnde = true; - } - - try - { - int colorCode = Integer.parseInt(toWrite.substring(index, index + 1)); - - index++; - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE2) - { - parsEnde = true; - StyleConstants.setForeground(attributes, Color.BLACK); - } - } - catch(StringIndexOutOfBoundsException sioobE) - { - parsEnde = true; - try - { - int colorCode = Integer.parseInt(toWrite.substring(index, index + 1)); - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE2) - { - StyleConstants.setForeground(attributes, Color.BLUE); - } - catch(StringIndexOutOfBoundsException nfE2) - { - StyleConstants.setForeground(attributes, Color.BLACK); - } - - return attributes; - } - } - } - - try - { - doc.insertString(doc.getLength(), toWrite.substring(index), attributes); - } - catch(BadLocationException ex) - { - ex.printStackTrace(); - } - - return attributes; - } - - private Color getColor(int code) - { - switch(code) - { - - case 0: - return Color.BLACK; - - case 1: - return Color.BLACK; - - case 2: - return Color.BLUE; - - case 3: - return Color.GREEN; - - case 4: - return Color.RED; - - case 5: - return Color.BLACK; - - case 6: - return Color.PINK; - - case 7: - return Color.ORANGE; - - case 8: - return Color.YELLOW; - - case 9: - return Color.GREEN; - - case 10: - return Color.GREEN; - - case 11: - return Color.CYAN; - - case 12: - return Color.BLUE; - - case 13: - return Color.PINK; - - case 14: - return Color.GRAY; - - case 15: - return Color.LIGHT_GRAY; - - default: - return Color.BLACK; - } - } - - public void updateTextArea(String message, boolean withTimeStamp) - { - Document doc = textArea.getDocument(); - int oldCaretPosition = textArea.getCaretPosition(); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - - StyleConstants.setBackground(attributes, Color.WHITE); - StyleConstants.setForeground(attributes, Color.BLACK); - int index = message.indexOf('>'); - String compareValue; - boolean eigenerName = false; - boolean doMark = false; - - if(index != -1 && message.length() - 1 > index) - { - compareValue = message.substring(index + 1); - } - else - { - compareValue = message; - } - - boolean isAction = false; - - if(compareValue.indexOf(parentPanel.getNickname()) != -1) - { - StyleConstants.setBackground(attributes, Color.ORANGE); - eigenerName = true; - doMark = true; - } - else if(message.indexOf("---> JOIN:") != -1) - { - StyleConstants.setForeground(attributes, JOIN_GREEN); - } - else if(message.indexOf("<--- PART:") != -1) - { - StyleConstants.setForeground(attributes, Color.RED); - } - else if(message.indexOf("<--- QUIT:") != -1) - { - StyleConstants.setForeground(attributes, Color.RED); - } - else if(message.indexOf('>') == 0) - { - StyleConstants.setForeground(attributes, Color.MAGENTA); - } - else if(message.startsWith("* ")) - { - isAction = true; - } - else if(!withTimeStamp || index == -1) - { - StyleConstants.setForeground(attributes, Color.GRAY); - } - else - { - StyleConstants.setForeground(attributes, Color.BLACK); - doMark = true; - } - - try - { - if(withTimeStamp) - { - String zeit = dateFormatter.format(new Date(System.currentTimeMillis())); - - doc.insertString(doc.getLength(), "[" + zeit + "]\t", attributes); - } - - if(isAction) - { - Color color = StyleConstants.getForeground(attributes); - - StyleConstants.setForeground(attributes, Color.MAGENTA); - doc.insertString(doc.getLength(), "\t*", attributes); - StyleConstants.setForeground(attributes, color); - message = message.substring(1).trim(); - } - - parseLinks(attributes, doc, message); - } - catch(BadLocationException blE) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error("Fehler im IrcPlugin", blE); - } - } - - if(!selected && doMark) - { - if(eigenerName) - { - for(int i = 0; i < tabbedPane.getTabCount(); i++) - { - Object tab = tabbedPane.getComponentAt(i); - - if(tab == this) - { - tabbedPane.setForegroundAt(i, Color.GREEN); - } - } - } - - if(!eigenerName && !marked) - { - for(int i = 0; i < tabbedPane.getTabCount(); i++) - { - Object tab = tabbedPane.getComponentAt(i); - - if(tab == this) - { - tabbedPane.setForegroundAt(i, Color.RED); - } - } - } - - marked = true; - } - - int newCaretPosition = doc.getLength(); - - if(newCaretPosition != oldCaretPosition) - { - textArea.setCaretPosition(newCaretPosition); - } - - usernameList.reorder(); - } - - private void parseLinks(SimpleAttributeSet attributes, Document doc, String message) - throws BadLocationException - { - while(message.toLowerCase().indexOf(HTTP_IDENTIFIER) != -1 || message.toLowerCase().indexOf(WWW_IDENTIFIER) != -1) - { - String httpIdentifier; - int indexHttp = message.toLowerCase().indexOf(HTTP_IDENTIFIER); - int indexWww = message.toLowerCase().indexOf(WWW_IDENTIFIER); - - if(indexHttp == -1) - { - httpIdentifier = WWW_IDENTIFIER; - } - else if(indexWww == -1) - { - httpIdentifier = HTTP_IDENTIFIER; - } - else - { - if(indexWww == indexHttp + HTTP_IDENTIFIER.length()) - { - httpIdentifier = HTTP_IDENTIFIER; - } - else - { - httpIdentifier = WWW_IDENTIFIER; - } - } - - doc.insertString(doc.getLength(), message.substring(0, message.toLowerCase().indexOf(httpIdentifier)), attributes); - message = message.substring(message.toLowerCase().indexOf(httpIdentifier)); - int index = message.indexOf(" "); - int index2 = message.indexOf(">"); - - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf(")"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf("]"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf("}"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - if(index != -1) - { - doc.insertString(doc.getLength(), message.substring(0, index), setLink(message.substring(0, index), attributes)); - message = message.substring(index); - if(message.indexOf(httpIdentifier, index) == -1) - { - break; - } - } - else - { - doc.insertString(doc.getLength(), message, setLink(message, attributes)); - message = ""; - } - } - - doc.insertString(doc.getLength(), message + "\n", attributes); - } - - public void updateTextArea(String message) - { - updateTextArea(message, true); - } - - public void updateUserArea(String username, String command) - { - if(command.equals("add")) - { - User user; - - if(username.indexOf('!') == 0 || username.indexOf('@') == 0 || username.indexOf('%') == 0 || username.indexOf('+') == 0) - { - char mod = username.charAt(0); - - username = username.substring(1); - user = new User(username); - switch(mod) - { - - case '!': - { - user.setAdmin(true); - break; - } - - case '@': - { - user.setOp(true); - break; - } - - case '%': - { - user.setHalfop(true); - break; - } - - case '+': - { - user.setVoice(true); - break; - } - } - } - else - { - user = new User(username); - } - - usernameList.add(user); - } - - else if(command.equals("remove")) - { - if(username.indexOf('!') == 0 || username.indexOf('@') == 0 || username.indexOf('%') == 0 || username.indexOf('+') == 0) - { - username = username.substring(1); - } - - User[] users = usernameList.getValues(); - User user = null; - - for(int i = 0; i < users.length; i++) - { - if(users[i].getName().equalsIgnoreCase(username)) - { - user = users[i]; - break; - } - } - - if(user != null) - { - usernameList.remove(user); - } - } - - updateCounter(); - } - - public void userQuits(String nick, boolean hide) - { - User nickToRemove = null; - - synchronized(usernameList) - { - User[] users = usernameList.getValues(); - - for(int i = 0; i < users.length; i++) - { - if(users[i].getName().equalsIgnoreCase(nick)) - { - nickToRemove = users[i]; - break; - } - } - } - - if(nickToRemove != null) - { - usernameList.remove(nickToRemove); - } - - if(nickToRemove != null && !hide) - { - updateTextArea("<--- QUIT: " + nickToRemove); - } - } - - public void renameUser(String oldNick, String newNick) - { - User searchedNick = null; - - synchronized(usernameList) - { - User[] users = usernameList.getValues(); - String compareValue; - - for(int i = 0; i < users.length; i++) - { - if(users[i].getName().compareToIgnoreCase(oldNick) == 0) - { - searchedNick = users[i]; - break; - } - } - } - - if(searchedNick != null) - { - searchedNick.setName(newNick); - usernameList.reorder(); - updateTextArea(oldNick + " changes nickname to " + newNick); - } - } - - private void updateCounter() - { - counter.setText(usernameList.getOpCount() + " Ops, " + usernameList.getSize() + " " + counterText); - } - - public void fireLanguageChanged() - { - counterText = parentPanel.getPlugin().getLanguageString(".root.language.channel.gesamt"); - updateCounter(); - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/CommandInterpreter.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/CommandInterpreter.java deleted file mode 100644 index 740ea4bf..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/CommandInterpreter.java +++ /dev/null @@ -1,102 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -/* - * @(#) jqIRC 0.4 08/12/2001 - * - * Copyright (c), 2000 by jqIRC, Inc. ^-^ - * - * License: We grant you this piece of source code to play with - * as you wish provided that 1) you buy us a drink when we meet - * somewhere someday. 2) Incase you don't want to fullfill the - * first condition, you just buy something for one of your - * beloved friends. 3) Attach below messages somewhere. ^-^ - * - * To some people, a friend - * is practically anyone they know. - * To me, friendship means - * a much closer relationship, - * one in which you take the time - * to really understand each other. - * A friend is someone you trust enough - * to share a part of yourself - * the rest of the world may never see. - * That kind of friendship - * doesn't come along everyday... - * but that's the way it should be. - * - */ - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/CommandInterpreter.java,v 1.3 2004/10/15 13:34:47 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r - * - */ - -import java.util.*; - -public class CommandInterpreter { - String lineToServer; - String command = "", - param1 = "", - message = ""; - - public CommandInterpreter(String lineToServer) { - this.lineToServer = lineToServer; - init_all(); - } - - private void init_all() { - if (lineToServer.startsWith("/")) - { - StringTokenizer st = new StringTokenizer(lineToServer, " \r\n"); - int totalTokens = st.countTokens(); - if (totalTokens >= 3) - { - String temp = st.nextToken(); - - temp = temp.toUpperCase(); - temp = temp.substring(1); - command = temp; - - temp = st.nextToken(); - param1 = temp; - - temp = st.nextToken("\n"); - if (temp.startsWith(" ")) - { - temp = temp.substring(1); - - } - message = temp; - } - else if (totalTokens == 2) - { - String temp = st.nextToken(); - - temp = temp.toUpperCase(); - temp = temp.substring(1); - command = temp; - - temp = st.nextToken(); - param1 = temp; - } - } - } - - public String getCommand() { - return command; - } - - public String getParam1() { - return param1; - } - - public String getMessage() { - return message; - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/InitPanel.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/InitPanel.java deleted file mode 100644 index b7bc93c8..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/InitPanel.java +++ /dev/null @@ -1,216 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.text.BadLocationException; -import javax.swing.text.MutableAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.Document; -import javax.swing.text.StyledDocument; - -import java.util.Date; -import java.net.URL; -import java.text.SimpleDateFormat; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.gui.start.HyperlinkAdapter; - -/** - * $Header: - * /cvsroot/applejuicejava/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/InitPanel.java,v - * 1.6 2004/11/22 16:25:25 maj0r Exp $ - * - *

- * Titel: AppleJuice Client-GUI - *

- *

- * Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten - * appleJuice-Core - *

- *

- * Copyright: General Public License - *

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ - -public class InitPanel extends JPanel implements ActionListener { - private final String name = "Init Window"; - - private final JTextPane textArea = new JTextPane(); - private final JTextField textField = new JTextField(); - private StyledDocument document = (StyledDocument) textArea - .getStyledDocument(); - private JTextField titleArea; - private XdccIrc parentPanel; - private SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss"); - private Logger logger; - - public InitPanel(XdccIrc parentPanel) { - logger = Logger.getLogger(getClass()); - this.parentPanel = parentPanel; - makePanel(); - } - - private void makePanel() { - textArea.setEditorKit(new LinkEditorKit()); - textArea.setDocument(document); - textArea.setEditable(false); - textArea.addHyperlinkListener(new HyperlinkAdapter(textArea)); - setLayout(new BorderLayout()); - - textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - textArea.setBackground(Color.WHITE); - textField.addActionListener(this); - - JScrollPane sp1 = new JScrollPane(textArea); - - sp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - add(sp1, BorderLayout.CENTER); - add(textField, BorderLayout.SOUTH); - add(makeNorth(), BorderLayout.NORTH); - } - - private MutableAttributeSet setLink(String sUrl, SimpleAttributeSet attributes) { - MutableAttributeSet a = new SimpleAttributeSet(attributes); - try { - if (!sUrl.toLowerCase().startsWith(ChannelPanel.HTTP_IDENTIFIER)){ - sUrl = ChannelPanel.HTTP_IDENTIFIER + sUrl; - } - URL url = new URL(sUrl); - a.addAttribute(LinkEditorKit.LINK, new URL(sUrl)); - } catch (Exception e) { - // nothing to do - } - a.addAttribute(StyleConstants.Bold, Boolean.TRUE); - a.addAttribute(StyleConstants.Underline, Boolean.TRUE); - return a; - } - - private Box makeNorth() { - Box northBox = Box.createHorizontalBox(); - titleArea = new JTextField("Not connected yet"); - titleArea.setEditable(false); - northBox.add(titleArea); - return northBox; - } - - public void actionPerformed(ActionEvent e) { - Object source = e.getSource(); - - // let's take care of textField - if (source == textField) { - String message = textField.getText(); - - if (message.startsWith("/")) { - // commands that start with "/" - if (message.toLowerCase().indexOf("nickserv identify ") == -1) { - updateTextArea(message); - } - message = message.substring(1); - textField.setText(""); - - parentPanel.parseSendToCommand(message); - } else { - // update textArea - updateTextArea(message); - textField.setText(""); - - parentPanel.parseSendToCommand(message); - } - } - } - - public void resetTextField() { - textField.setText(""); - } - - public void setTitleArea(String message) { - titleArea.setText(message); - } - - public void updateTextArea(String message) { - int oldCaretPosition = textArea.getCaretPosition(); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - StyleConstants.setBackground(attributes, Color.WHITE); - StyleConstants.setForeground(attributes, Color.BLACK); - Document doc = textArea.getDocument(); - String zeit = dateFormatter.format(new Date(System.currentTimeMillis())); - try { - doc.insertString(doc.getLength(), "[" + zeit + "]\t", attributes); - while (message.toLowerCase().indexOf(ChannelPanel.HTTP_IDENTIFIER) != -1 || - message.toLowerCase().indexOf(ChannelPanel.WWW_IDENTIFIER) != -1){ - String httpIdentifier; - int indexHttp = message.toLowerCase().indexOf(ChannelPanel.HTTP_IDENTIFIER); - int indexWww = message.toLowerCase().indexOf(ChannelPanel.WWW_IDENTIFIER); - if (indexHttp == -1){ - httpIdentifier = ChannelPanel.WWW_IDENTIFIER; - } - else if (indexWww == -1){ - httpIdentifier = ChannelPanel.HTTP_IDENTIFIER; - } - else{ - if (indexWww == indexHttp + ChannelPanel.HTTP_IDENTIFIER.length()){ - httpIdentifier = ChannelPanel.HTTP_IDENTIFIER; - } - else{ - httpIdentifier = ChannelPanel.WWW_IDENTIFIER; - } - } - - doc.insertString(doc.getLength(), - message.substring(0, - message.toLowerCase().indexOf(httpIdentifier)), - attributes); - message = message.substring(message.toLowerCase().indexOf(httpIdentifier)); - int index = message.indexOf(" "); - int index2 = message.indexOf(">"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf(")"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf("]"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf("}"); - if (index2 != -1 && index2 < index){ - index = index2; - } - if (index != -1){ - doc.insertString(doc.getLength(), message.substring(0, index), - setLink(message.substring(0, index), attributes)); - message = message.substring(index); - } - else{ - doc.insertString(doc.getLength(), message, setLink(message, attributes)); - message = ""; - } - } - doc.insertString(doc.getLength(), message + "\n", attributes); - } catch (BadLocationException ex) { - if (logger.isEnabledFor(Level.ERROR)) { - logger.error("Fehler im IrcPlugin", ex); - } - } - int newCaretPosition = textArea.getDocument().getLength(); - if (newCaretPosition != oldCaretPosition) { - textArea.setCaretPosition(newCaretPosition); - } - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPlugin.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPlugin.java deleted file mode 100644 index b6c55647..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPlugin.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; - -import java.util.Map; -import java.util.Properties; - -import javax.swing.ImageIcon; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import de.applejuicenet.client.AppleJuiceClient; -import de.applejuicenet.client.gui.plugins.PluginConnector; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPlugin.java,v 1.3 2009/01/12 10:09:19 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class IrcPlugin extends PluginConnector -{ - private XdccIrc xdccIrc; - private String savePath; - private Properties properties; - - public IrcPlugin(Properties pluginProperties, Map languageFiles, ImageIcon icon, - Map availableIcons) - { - super(pluginProperties, languageFiles, icon, availableIcons); - init(); - } - - private void init() - { - savePath = AppleJuiceClient.getPropertiesPath(); - int index = savePath.lastIndexOf(File.separator); - - savePath = savePath.substring(0, index) + File.separator + "ircplugin.properties"; - properties = new Properties(); - File tmpFile = new File(savePath); - - if(tmpFile.isFile()) - { - try - { - FileInputStream fiS = new FileInputStream(tmpFile); - - properties.load(fiS); - fiS.close(); - } - catch(IOException ex) - { - ex.printStackTrace(); - } - } - - setLayout(new BorderLayout()); - xdccIrc = new XdccIrc(this); - add(xdccIrc, BorderLayout.CENTER); - } - - public void saveProperties() - { - try - { - properties.store(new FileOutputStream(savePath), "ajIrcPlugin-PropertyFile"); - } - catch(IOException ex) - { - ex.printStackTrace(); - } - } - - public Properties getProperties() - { - return properties; - } - - public void fireLanguageChanged() - { - xdccIrc.fireLanguageChanged(); - } - - /*Wird automatisch aufgerufen, wenn neue Informationen vom Server eingegangen sind. - �ber den DataManger k�nnen diese abgerufen werden.*/ - public void fireContentChanged(DATALISTENER_TYPE type, Object content) - { - } - - public void registerSelected() - { - } - - public JPanel getOptionPanel() - { - JPanel panel1 = new JPanel(new GridBagLayout()); - final JTextField nick = new JTextField(); - - nick.setMinimumSize(new Dimension(200, nick.getPreferredSize().height)); - nick.setPreferredSize(new Dimension(200, nick.getPreferredSize().height)); - final JTextField passwort = new JTextField(); - final JTextField onJoinMessage = new JTextField(); - final JTextField channels = new JTextField(); - final JCheckBox rules = new JCheckBox(); - GridBagConstraints constraints = new GridBagConstraints(); - - constraints.anchor = GridBagConstraints.NORTH; - constraints.fill = GridBagConstraints.BOTH; - constraints.gridx = 0; - constraints.gridy = 0; - constraints.insets = new Insets(5, 0, 0, 0); - constraints.insets.left = 5; - panel1.add(new JLabel("Nickname: "), constraints); - constraints.gridy = 1; - panel1.add(new JLabel("Passwort: "), constraints); - constraints.gridy = 2; - panel1.add(new JLabel("OnJoinMessage: "), constraints); - constraints.gridy = 3; - panel1.add(new JLabel("Channels: "), constraints); - constraints.insets.right = 5; - constraints.gridx = 1; - constraints.gridy = 0; - constraints.weightx = 1; - panel1.add(nick, constraints); - constraints.weightx = 0; - constraints.gridy = 1; - panel1.add(passwort, constraints); - constraints.gridy = 2; - panel1.add(onJoinMessage, constraints); - constraints.gridy = 3; - panel1.add(channels, constraints); - constraints.gridx = 0; - constraints.gridwidth = 2; - constraints.gridy = 4; - rules.setText(getLanguageString("language.disablerules")); - panel1.add(rules, constraints); - String propNick = properties.getProperty("nick"); - - if(propNick != null) - { - nick.setText(propNick); - } - - String propOnJoin = properties.getProperty("onjoin"); - - if(propOnJoin != null) - { - onJoinMessage.setText(propOnJoin); - } - - String propChannels = properties.getProperty("channels"); - - if(propChannels != null) - { - channels.setText(propChannels); - } - - nick.addFocusListener(new FocusAdapter() - { - public void focusLost(FocusEvent fe) - { - properties.put("nick", nick.getText()); - saveProperties(); - } - }); - onJoinMessage.addFocusListener(new FocusAdapter() - { - public void focusLost(FocusEvent fe) - { - properties.put("onjoin", onJoinMessage.getText()); - saveProperties(); - } - }); - channels.addFocusListener(new FocusAdapter() - { - public void focusLost(FocusEvent fe) - { - properties.put("channels", channels.getText()); - saveProperties(); - } - }); - passwort.addFocusListener(new FocusAdapter() - { - public void focusLost(FocusEvent fe) - { - properties.put("passwort", passwort.getText()); - saveProperties(); - } - }); - rules.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - properties.put("norules", new Boolean(rules.isSelected()).toString()); - } - }); - return panel1; - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPluginTestLoader.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPluginTestLoader.java deleted file mode 100644 index 7720990e..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcPluginTestLoader.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.util.Map; -import java.util.Properties; - -import javax.swing.ImageIcon; - -import de.applejuicenet.client.gui.plugincontrol.TestLoader; -import de.applejuicenet.client.gui.plugins.PluginConnector; - -public class IrcPluginTestLoader extends TestLoader -{ - public IrcPluginTestLoader() - { - super(); - } - - @Override - protected String getPath() - { - return "ircplugin"; - } - - @Override - protected PluginConnector getPlugin(Properties pluginProperties, Map languageFiles, ImageIcon icon, - Map availableIcons) - { - return new IrcPlugin(pluginProperties, languageFiles, icon, availableIcons); - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcUser.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcUser.java deleted file mode 100644 index 84be7f9d..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/IrcUser.java +++ /dev/null @@ -1,89 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -public class IrcUser{ - public static final int MOD_USER = -1; - public static final int MOD_VOICE = 0; - public static final int MOD_HALFOP = 1; - public static final int MOD_OP = 2; - public static final int MOD_ADMIN = 3; - - private String nick; - private int mod; - - public IrcUser(String nick, int mod){ - this.nick = nick; - this.mod = mod; - } - - public String toString(){ - switch (mod){ - case MOD_VOICE: return "+" + nick; - case MOD_HALFOP: return "%" + nick; - case MOD_OP: return "@" + nick; - case MOD_ADMIN: return "!" + nick; - default: return nick; - } - } - - public String getString(){ - return nick; - } - - public int getMod(){ - return mod; - } - - public int compareTo(Object object){ - if (object.getClass() != IrcUser.class) { - return -1; - } - int mod2 = ((IrcUser)object).getMod(); - switch (mod){ - case MOD_ADMIN: { - if (mod2 == MOD_ADMIN) { - return 0; - } - else { - return 1; - } - } - case MOD_OP: { - if (mod2 == MOD_ADMIN) { - return 1; - } - else if (mod2 == MOD_OP) { - return 0; - } - else { - return -1; - } - } - case MOD_HALFOP: { - if (mod2 == MOD_ADMIN || mod2 == MOD_OP) { - return 1; - } - else if (mod2 == MOD_HALFOP) { - return 0; - } - else { - return -1; - } - } - case MOD_VOICE: { - if (mod2 == MOD_ADMIN || mod2 == MOD_OP - || mod2 == MOD_HALFOP) { - return 1; - } - else if (mod2 == MOD_VOICE) { - return 0; - } - else { - return -1; - } - } - default: { - return 0; - } - } - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/LinkEditorKit.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/LinkEditorKit.java deleted file mode 100644 index 68a99716..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/LinkEditorKit.java +++ /dev/null @@ -1,106 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; -import java.net.URL; - -import javax.swing.JEditorPane; -import javax.swing.SwingUtilities; -import javax.swing.event.HyperlinkEvent; -import javax.swing.text.Element; -import javax.swing.text.Position; -import javax.swing.text.StyledDocument; -import javax.swing.text.StyledEditorKit; - -public class LinkEditorKit extends StyledEditorKit { - public static final Object LINK = new StringBuffer("LINK"); - private static LinkHandler linkHandler = new LinkHandler(); - - public LinkEditorKit() {} - - public void install(JEditorPane p) { - super.install(p); - p.addMouseListener(linkHandler); - p.addMouseMotionListener(linkHandler); - } - - public void deinstall(JEditorPane p) { - p.removeMouseListener(linkHandler); - p.removeMouseMotionListener(linkHandler); - super.deinstall(p); - } - - private static class LinkHandler extends MouseAdapter implements - MouseMotionListener { - private Element activeElement; - - private Element characterElementAt(MouseEvent e) { - JEditorPane p = (JEditorPane) e.getComponent(); - Position.Bias[] bias = new Position.Bias[1]; - int position = p.getUI().viewToModel(p, e.getPoint(), bias); - if (bias[0] == Position.Bias.Backward && position != 0){ - --position; - } - Element c = ((StyledDocument) p.getDocument()) - .getCharacterElement(position); - return c; - } - - public void mouseMoved(MouseEvent e) { - JEditorPane p = (JEditorPane) e.getComponent(); - if (!p.isEditable()) { - Element c = characterElementAt(e); - Object target = c.getAttributes().getAttribute(LINK); - if (!(target instanceof URL)) { - target = null; - } - if (target != null) { - p.fireHyperlinkUpdate(new HyperlinkEvent(p, - HyperlinkEvent.EventType.ENTERED, (URL) target, - null, c)); - } else { - p.fireHyperlinkUpdate(new HyperlinkEvent(p, - HyperlinkEvent.EventType.EXITED, (URL) target, - null, c)); - } - } - } - - public void mouseDragged(MouseEvent e) {} - - public void mouseEntered(MouseEvent e) {} - - public void mousePressed(MouseEvent e) { - if (!SwingUtilities.isLeftMouseButton(e)){ - return; - } - JEditorPane p = (JEditorPane) e.getComponent(); - if (p.isEditable()){ - return; - } - Element c = characterElementAt(e); - if (c != null && c.getAttributes().getAttribute(LINK) != null) { - activeElement = c; - } - } - - public void mouseReleased(MouseEvent e) { - if (!SwingUtilities.isLeftMouseButton(e) || activeElement == null){ - return; - } - JEditorPane p = (JEditorPane) e.getComponent(); - Element c = characterElementAt(e); - if (!p.isEditable() && c == activeElement) { - activeElement = null; - Object target = c.getAttributes().getAttribute(LINK); - if (!(target instanceof URL)){ - target = null; - } - p.fireHyperlinkUpdate(new HyperlinkEvent(p, - HyperlinkEvent.EventType.ACTIVATED, (URL) target, null, - c)); - } - } - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/RulesDialog.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/RulesDialog.java deleted file mode 100644 index d57aded3..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/RulesDialog.java +++ /dev/null @@ -1,142 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.fassade.ApplejuiceFassade; -import de.applejuicenet.client.fassade.shared.ZeichenErsetzer; -import de.applejuicenet.client.gui.controller.LanguageSelector; -import de.applejuicenet.client.gui.controller.OptionsManagerImpl; - -public class RulesDialog extends JDialog{ - private Logger logger; - - public RulesDialog(Frame parent, boolean modal){ - super(parent, modal); - logger = Logger.getLogger(getClass()); - try{ - setTitle("#applejuice - Chanrules"); - getContentPane().setLayout(new BorderLayout()); - JTextPane rules = new JTextPane(); - rules.setContentType("text/html"); - rules.setEditable(false); - rules.setText(channelrules); - rules.addHyperlinkListener(new HyperlinkListener() { - public void hyperlinkUpdate(HyperlinkEvent e) { - if (e.getEventType() == - HyperlinkEvent.EventType.ACTIVATED) { - if (e.getURL() != null) { - String url = e.getURL().toString(); - if (url.length() != 0) { - executeLink(url); - } - } - } - } - }); - JScrollPane sp = new JScrollPane(rules); - sp.setHorizontalScrollBarPolicy(JScrollPane. - HORIZONTAL_SCROLLBAR_NEVER); - getContentPane().add(sp, BorderLayout.CENTER); - JButton ok = new JButton("OK"); - ok.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - dispose(); - } - }); - getContentPane().add(ok, BorderLayout.SOUTH); - setSize(650, 500); - Dimension size = getSize(); - Dimension screenSize = Toolkit.getDefaultToolkit(). - getScreenSize(); - setBounds( (screenSize.width - size.width) / 2, - (screenSize.height - size.height) / 2, size.width, size.height); - } - catch(Exception e){ - if (logger.isEnabledFor(Level.ERROR)) { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); - } - } - } - - private void executeLink(String link) { - try { - String browser = OptionsManagerImpl.getInstance(). - getStandardBrowser(); - try { - Runtime.getRuntime().exec(new String[] {browser, link}); - } - catch (Exception ex) { - LanguageSelector ls = LanguageSelector. - getInstance(); - String nachricht = ZeichenErsetzer.korrigiereUmlaute(ls. - getFirstAttrbuteByTagName(".root.javagui.startup.updatefehlernachricht")); - String titel = ZeichenErsetzer.korrigiereUmlaute(ls. - getFirstAttrbuteByTagName(".root.mainform.caption")); - JOptionPane.showMessageDialog(this, nachricht, - titel, JOptionPane.INFORMATION_MESSAGE); - } - } - catch (Exception e) { - if (logger.isEnabledFor(Level.ERROR)) { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); - } - } - } - - private String channelrules = - "

In diesem Channel gibt es Regeln, die zu beachten sind.

" + - "

Regeln

  1. Keine Verbreitung/Unterstützung oder Andeutungen zur Verbreitung zu " + - "illegalen Daten, Inhalten und Links jeglicher Art.
    Dies betrifft ausdrücklich jede " + - "erdenkliche Form, so zB die Nutzung von Nicks wie aj-user^splintercell vor dem offiziellen " + - "Releasetermin, VHosts, Quit-Messages, Chan-Notices und was es noch so alles gibt.

    " + - "
  2. Keine Frage \"ob man fragen darf\". Keine Metafragen. Keine andauernden " + - "Wiederholungen. (=Spamm)
    Dieser Channel ist zu einem guten Teil dazu da" + - ", um den Nutzern Unterstützung anzubieten, und um dem Entwickler Rü" + - "ckmeldungen zu geben, d.h. das Fragen bezüglich Applejuice oder Fehlerreports " + - "ausdrücklich erwünscht sind. Frage dennoch freundlich, denn der Channel " + - "garantiert natürlich keine Support. Fragen der Art \"Ist XYZ besser als " + - "Applejuice?\" oder \"Hast du von XYZ Ahnung?\" sind letzlich immer subjektiv zu " + - "beantworten. Versuche deshalb deine Fragen so exakt und zielgerichtet wie mö" + - "glich zu stellen. Auch das ständige Wechseln des Nickname ist nicht erwünscht. Wozu gibt es /away.

    " + - "
  3. Kein Spamm, keine Werbung, keine Floods, und schon gar kein \"Cracking\" !
    " + - "Jeglicher Spamm ist nicht erwünscht: Mp3-Scripte, Onjoin-Spamm, " + - "Ontext-Spamm usw. Es sind keine Channel-CTCPs erwünscht. Werbung in jeglicher " + - "Form ist nicht erwünscht. Übermässige und sinnlose Nutzung von Farbcodes wird " + - "als Spamm betrachtet. Das Verteilen von viralem/lethalen Code jeglicher Art " + - "ist verboten und wird verfolgt!

    " + - "
  4. Keine Beleidigungen. Verhalte und unterhalte dich wie von Angesicht zu " + - "Angesicht.
    Es gelten die gleichen sozialen Verhaltensgrundregeln wie " + - "im normalem Leben. Das schliesst die demokratische Hierarchie des IRC ein " + - "gelegentlicher Streit kann im Querry ausgetragen werden. Beleidigung und " + - "auschliessliche Nutzung von Fäkalsprache werden nicht toleriert.

    " + - "
  5. Keine Admin/Op/halfOp Betteleien, keine Querries an die Admins/OPs/" + - "halfOPs ohne Einverständnis. Keine Bots ohne Einverständnis.

 

" + - "

Die Anweisungen der Admins, Ops und HalfOPs sind zu " + - "befolgen. Normalerweise macht dich ein netter Mensch auf deinen Regelverstoss " + - "aufmerksam, da du offensichtlich nicht nach Betreten des Channels die " + - "Chanrules gelesen hast. Solltest du dennoch nicht auf die Hinweise achten, " + - "hast du dein Anwesenheitsrecht verwirkt. Auf eingeschaltetes Auto-Rejoin nach " + - "Kick wird mit Ban reagiert, da Auto-Rejoin den Sinn eines Kick untergräbt.

" + - "

Sollte ein \"klärendes Gespräch\" per Query auch nur zu " + - "einem Ban geführt haben, und das bereitet dir schlaflose Nächte, dann " + - "solltest du deinen Umgangston überdenken. Wende dich in diesem Fall ans Forum. Und nun " + - "viel Spass im IRC:)

"+ - "

Diesen Dialog kannst Du über Optionen->Plugins->IrcPlugin deaktivieren.

"; -} \ No newline at end of file diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/SortedListModel.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/SortedListModel.java deleted file mode 100644 index aafca183..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/SortedListModel.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.util.ArrayList; -import java.util.Comparator; - -import javax.swing.AbstractListModel; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/SortedListModel.java,v 1.15 2009/01/12 10:09:19 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class SortedListModel extends AbstractListModel -{ - private ArrayList model = new ArrayList(); - private StringComparator comparator = new StringComparator(); - - public SortedListModel() - { - } - - public int getSize() - { - return model.size(); - } - - public User[] getValues() - { - return (User[]) model.toArray(new User[model.size()]); - } - - public synchronized Object getElementAt(int index) - { - if(index < model.size()) - { - return model.toArray()[index]; - } - else - { - return null; - } - } - - public synchronized void add(User user) - { - if(model.add(user)) - { - fireIntervalAdded(this, 0, getSize()); - } - } - - public synchronized void clear() - { - model.clear(); - fireIntervalRemoved(this, 0, getSize()); - } - - public boolean contains(Object element) - { - return model.contains(element); - } - - public synchronized boolean remove(User user) - { - boolean removed = model.remove(user); - - if(removed) - { - fireIntervalRemoved(this, 0, getSize()); - } - - return removed; - } - - public void fireIntervalAdded(Object source, int index0, int index1) - { - super.fireIntervalAdded(source, index0, index1); - reorder(); - } - - public void fireIntervalRemoved(Object source, int index0, int index1) - { - super.fireIntervalRemoved(source, index0, index1); - reorder(); - } - - public int getOpCount() - { - int ops = 0; - - for(int i = 0; i < model.size(); i++) - { - if((model.get(i)).isAdmin() || (model.get(i)).isOp() || (model.get(i)).isHalfop()) - { - ops++; - } - } - - return ops; - } - - public void reorder() - { - int n = model.size(); - - for(int i = 0; i < n - 1; i++) - { - int k = i; - - for(int j = i + 1; j < n; j++) - { - if(comparator.compare(model.get(j), model.get(k)) < 0) - { - k = j; - } - } - - User tmp = model.get(i); - - model.set(i, model.get(k)); - model.set(k, tmp); - } - - this.fireContentsChanged(this, 0, getSize()); - } - - private class StringComparator implements Comparator - { - public int compare(Object o1, Object o2) - { - if(o1.getClass() == User.class && o2.getClass() == User.class) - { - int mods = 0; - - try - { - mods = compareMods((User) o1, (User) o2); - } - catch(StringIndexOutOfBoundsException saoobE) - { - mods = 0; - } - - if(mods != 0) - { - return mods; - } - else - { - return (((User) o1).getName()).compareToIgnoreCase(((User) o2).getName()); - } - } - else - { - if(o1.hashCode() == o2.hashCode()) - { - return 0; - } - else if(o1.hashCode() <= o2.hashCode()) - { - return -1; - } - else - { - return 1; - } - } - } - - private int compareMods(User mod1, User mod2) - { - if(mod1.getRechteAsInt() == mod2.getRechteAsInt()) - { - return 0; - } - else if(mod1.getRechteAsInt() > mod2.getRechteAsInt()) - { - return -1; - } - else - { - return 1; - } - } - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/User.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/User.java deleted file mode 100644 index 182cf2ad..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/User.java +++ /dev/null @@ -1,81 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -public class User { - public static final int NOTHING = 0; - public static final int VOICE = 1; - public static final int HALFOP = 2; - public static final int OPERATOR = 4; - public static final int ADMINISTRATOR = 8; - - private String name; - - private int status = 0; - private boolean admin = false; - private boolean op = false; - private boolean halfop = false; - private boolean voice = false; - - public User(String name) { - this.name = name; - } - public boolean isAdmin() { - return admin; - } - - public void setAdmin(boolean enable) { - admin = enable; - } - - public boolean isHalfop() { - return halfop; - } - - public void setHalfop(boolean enable) { - halfop = enable; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public boolean isOp() { - return op; - } - - public void setOp(boolean enable) { - op = enable; - } - - public boolean isVoice() { - return voice; - } - - public void setVoice(boolean enable) { - voice = enable; - } - - public int getRechteAsInt(){ - int status = 0; - if (admin){ - status += ADMINISTRATOR; - } - if (op){ - status += OPERATOR; - } - if (halfop){ - status += HALFOP; - } - if (voice){ - status += VOICE; - } - return status; - } - - public String toString(){ - return name; - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserListCellRenderer.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserListCellRenderer.java deleted file mode 100644 index fa676d87..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserListCellRenderer.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.Component; - -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.ListCellRenderer; - -import de.applejuicenet.client.shared.IconManager; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserListCellRenderer.java,v 1.12 2009/01/07 15:21:33 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class UserListCellRenderer extends JLabel implements ListCellRenderer -{ - public UserListCellRenderer() - { - setOpaque(true); - } - - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) - { - setFont(list.getFont()); - if(value != null) - { - User user = (User) value; - - setText(user.getName()); - if(isSelected) - { - setBackground(list.getSelectionBackground()); - setForeground(list.getSelectionForeground()); - } - else - { - setForeground(list.getForeground()); - setBackground(list.getBackground()); - } - - if(user.isAdmin()) - { - setIcon(IconManager.getInstance().getIcon("irc_red", true, this.getClass())); - setToolTipText("Administrator"); - } - else if(user.isOp()) - { - setIcon(IconManager.getInstance().getIcon("irc_blue", true, this.getClass())); - setToolTipText("Operator"); - } - else if(user.isHalfop()) - { - setIcon(IconManager.getInstance().getIcon("irc_green", true, this.getClass())); - setToolTipText("Half-Operator"); - } - else if(user.isVoice()) - { - setIcon(IconManager.getInstance().getIcon("irc_yellow", true, this.getClass())); - setToolTipText("Voice"); - } - else - { - setIcon(null); - setToolTipText(null); - } - } - - return this; - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserPanel.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserPanel.java deleted file mode 100644 index ae564bfa..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserPanel.java +++ /dev/null @@ -1,288 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.MutableAttributeSet; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyledDocument; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.gui.start.HyperlinkAdapter; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/UserPanel.java,v 1.13 2005/01/21 16:19:42 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ - -public class UserPanel - extends JPanel - implements ActionListener { - private String name; - private final JTextPane textArea = new JTextPane(); - private StyledDocument document = (StyledDocument) textArea - .getStyledDocument(); - - private final JTextField textField = new JTextField(); - private JTextField titleArea = new JTextField(); - private JButton closeButton = new JButton("X"); - private XdccIrc parentPanel; - private boolean selected = false; - private boolean marked = false; - private JTabbedPane tabbedPane; - private SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss"); - private Logger logger; - - public UserPanel(XdccIrc parentPanel, String name, JTabbedPane tabbedPane) { - logger = Logger.getLogger(getClass()); - this.name = name; - this.parentPanel = parentPanel; - this.tabbedPane = tabbedPane; - makePanel(); - } - - public void selected(){ - selected = true; - } - - public void unselected(){ - selected = false; - marked = false; - } - - public void setName(String name) { - this.name = name; - } - - public void setTitleArea(String title) { - titleArea.setText(""); - titleArea.setText(title); - } - - private void makePanel() { - setLayout(new BorderLayout()); - - textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - textField.addActionListener(this); - textArea.setEditorKit(new LinkEditorKit()); - textArea.setDocument(document); - textArea.setEditable(false); - textArea.addHyperlinkListener(new HyperlinkAdapter(textArea)); - - titleArea.setEditable(false); - - JScrollPane sp1 = new JScrollPane(textArea); - - sp1.setVerticalScrollBarPolicy(JScrollPane. - VERTICAL_SCROLLBAR_ALWAYS); - - add(sp1, BorderLayout.CENTER); - add(textField, BorderLayout.SOUTH); - add(makeNorth(), BorderLayout.NORTH); - } - - private MutableAttributeSet setLink(String sUrl, SimpleAttributeSet attributes) { - MutableAttributeSet a = new SimpleAttributeSet(attributes); - try { - if (!sUrl.toLowerCase().startsWith(ChannelPanel.HTTP_IDENTIFIER)){ - sUrl = ChannelPanel.HTTP_IDENTIFIER + sUrl; - } - URL url = new URL(sUrl); - a.addAttribute(LinkEditorKit.LINK, new URL(sUrl)); - } catch (Exception e) { - // nothing to do - } - a.addAttribute(StyleConstants.Bold, Boolean.TRUE); - a.addAttribute(StyleConstants.Underline, Boolean.TRUE); - return a; - } - - private Box makeNorth() { - Box northBox = Box.createHorizontalBox(); - // let's add actions - closeButton.addActionListener(this); - northBox.add(closeButton); - northBox.add(titleArea); - return northBox; - } - - public void actionPerformed(ActionEvent e) { - Object source = e.getSource(); - - // let's take care of textField - if (source == textField) { - String message = textField.getText(); - - // let's send to the server - if (message.startsWith("/")) { - // A command - if (message.toLowerCase().compareTo("/ajstats") == 0 || message.toLowerCase().compareTo("/ajversinfo") == 0 - || message.toLowerCase().compareTo("/ajoptionsinfo") == 0) { - // todo - /* - long currentTime = System.currentTimeMillis(); - if (message.toLowerCase().compareTo("/ajstats") == 0){ - String text = AppleJuiceClient.getAjFassade().getInstance().getStats().substring(3); - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + text); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + - text); - } - else if (message.toLowerCase().compareTo("/ajversinfo") == 0) { - String text = ApplejuiceFassade.getInstance().getVersionInformation().substring(3); - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + text); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + - text); - } - else if (message.toLowerCase().compareTo("/ajoptionsinfo") == 0) { - String text = ApplejuiceFassade.getInstance().getOptionsInformation().substring(3); - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + text); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + - text); - } - */ - } - else if(message.toLowerCase().startsWith("/ajform=")){ - // todo - /* - String text = ApplejuiceFassade.getInstance().getFormatedStats(message.substring(8)).substring(3); - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + text); - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + - text); - */ - } - else{ - parentPanel.analyzeCommand(message); - } - textField.setText(""); - } - else { - // A normal private message to send to the user - parentPanel.parseSendToCommand("PRIVMSG " + name + " :" + message); - - // let's update textArea - updateTextArea(parentPanel.formatNickname("<" + parentPanel.getNickname() + "> ") + - textField.getText()); - resetTextField(); - } - } - else if (source == closeButton) { - parentPanel.closeChannel(parentPanel.getTabbedPane(), name); - } - } - - public void resetTextField() { - textField.setText(""); - } - - public void updateTextArea(String message) { - int oldCaretPosition = textArea.getCaretPosition(); - String zeit = dateFormatter.format(new Date(System. - currentTimeMillis())); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - StyleConstants.setBackground(attributes, Color.WHITE); - StyleConstants.setForeground(attributes, Color.BLACK); - Document doc = textArea.getDocument(); - try { - doc.insertString(doc.getLength(), "[" + zeit + "]\t", attributes); - while (message.toLowerCase().indexOf(ChannelPanel.HTTP_IDENTIFIER) != -1 || - message.toLowerCase().indexOf(ChannelPanel.WWW_IDENTIFIER) != -1){ - String httpIdentifier; - int indexHttp = message.toLowerCase().indexOf(ChannelPanel.HTTP_IDENTIFIER); - int indexWww = message.toLowerCase().indexOf(ChannelPanel.WWW_IDENTIFIER); - if (indexHttp == -1){ - httpIdentifier = ChannelPanel.WWW_IDENTIFIER; - } - else if (indexWww == -1){ - httpIdentifier = ChannelPanel.HTTP_IDENTIFIER; - } - else{ - if (indexWww == indexHttp + ChannelPanel.HTTP_IDENTIFIER.length()){ - httpIdentifier = ChannelPanel.HTTP_IDENTIFIER; - } - else{ - httpIdentifier = ChannelPanel.WWW_IDENTIFIER; - } - } - - doc.insertString(doc.getLength(), - message.substring(0, - message.toLowerCase().indexOf(httpIdentifier)), - attributes); - message = message.substring(message.toLowerCase().indexOf(httpIdentifier)); - int index = message.indexOf(" "); - int index2 = message.indexOf(">"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf(")"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf("]"); - if (index2 != -1 && index2 < index){ - index = index2; - } - index2 = message.indexOf("}"); - if (index2 != -1 && index2 < index){ - index = index2; - } - if (index != -1){ - doc.insertString(doc.getLength(), message.substring(0, index), - setLink(message.substring(0, index), attributes)); - message = message.substring(index); - } - else{ - doc.insertString(doc.getLength(), message, setLink(message, attributes)); - message = ""; - } - } - doc.insertString(doc.getLength(), message + "\n", attributes); - } - catch (BadLocationException ex) { - if (logger.isEnabledFor(Level.ERROR)){ - logger.error("Fehler im IrcPlugin", ex); - } - } - if (!selected && !marked){ - marked = true; - for (int i = 0; i < tabbedPane.getTabCount(); i++) { - Object tab = tabbedPane.getComponentAt(i); - if (tab == this) { - tabbedPane.setForegroundAt(i, Color.GREEN); - } - } - } - int newCaretPosition = textArea.getDocument().getLength(); - if (newCaretPosition != oldCaretPosition) { - textArea.setCaretPosition(newCaretPosition); - } - } - - public void userQuits(String nick){ - updateTextArea("<--- QUIT: " + nick); - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/XdccIrc.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/XdccIrc.java deleted file mode 100644 index 1cbc9bd6..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/XdccIrc.java +++ /dev/null @@ -1,1725 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.InterruptedIOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; - -import java.net.Socket; -import java.net.SocketException; - -import java.util.Random; -import java.util.StringTokenizer; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.JTextField; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.gui.AppleJuiceDialog; -import de.applejuicenet.client.shared.IconManager; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/XdccIrc.java,v 1.37 2009/01/12 10:09:19 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class XdccIrc extends JPanel -{ - private JButton connectButton; - private JButton cancelButton; - private Logger logger; - private Thread ircWorker; - private String host = "irc.devStaff.net"; - private int port = 6667; - private final String STANDARD_CHANNEL = "#applejuice"; - private JTabbedPane tabbedPane; - private String nickname; - private String realname; - - // Action to join a Channel - private JButton joinChannelAction; - private JButton createConnection; - private JButton changeNickAction; - private JButton newUserAction; - private String connectionInfo = "Connection Info"; - private String nicknameString = "Enter nickname"; - private String channelNameString = "Enter nickname"; - private String verbinden; - private String trennen; - private IrcPlugin parent; - private JDialog dialog; - private JTextField nickJTextField1; - private Socket chatSocket; - private BufferedReader fromServer; - private PrintWriter toServer; - private AppleJuiceDialog theApp = AppleJuiceDialog.getApp(); - private DisconnectActionListener disconnectActionListener = new DisconnectActionListener(); - private ConnectActionListener connectActionListener = new ConnectActionListener(); - private boolean doJoin = false; - private boolean first = true; - - public XdccIrc(IrcPlugin parent) - { - this.parent = parent; - logger = Logger.getLogger(getClass()); - try - { - setLayout(new BorderLayout()); - IconManager im = IconManager.getInstance(); - - createConnection = new JButton("Connect"); - createConnection.setIcon(im.getIcon("irc_login", true, this.getClass())); - createConnection.addActionListener(connectActionListener); - newUserAction = new JButton("Talk Private"); - newUserAction.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - newUser(); - } - }); - joinChannelAction = new JButton("Join a Channel"); - joinChannelAction.setIcon(im.getIcon("irc_chan", true, this.getClass())); - joinChannelAction.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - joinChan(); - } - }); - changeNickAction = new JButton("Change nick"); - changeNickAction.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - changeNick(); - } - }); - - connectButton = new JButton("Connect"); - cancelButton = new JButton("Cancel"); - - tabbedPane = createTabbedPane(); - tabbedPane.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - Object selected = tabbedPane.getSelectedComponent(); - - for(int i = 0; i < tabbedPane.getTabCount(); i++) - { - Object tab = tabbedPane.getComponentAt(i); - - if(tab == selected) - { - tabbedPane.setForegroundAt(i, Color.BLACK); - if(tab.getClass() == UserPanel.class) - { - ((UserPanel) tab).selected(); - } - else if(tab.getClass() == ChannelPanel.class) - { - ((ChannelPanel) tab).selected(); - } - } - else - { - if(tab.getClass() == UserPanel.class) - { - ((UserPanel) tab).unselected(); - } - else if(tab.getClass() == ChannelPanel.class) - { - ((ChannelPanel) tab).unselected(); - } - } - } - } - }); - - JPanel panel1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - - // Let's create a ToolBar - panel1.add(createConnection); - panel1.add(newUserAction); - panel1.add(joinChannelAction); - panel1.add(changeNickAction); - - add(panel1, BorderLayout.NORTH); - add(tabbedPane, BorderLayout.CENTER); - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error("Unbehandelte Exception", e); - } - } - } - - public IrcPlugin getPlugin() - { - return parent; - } - - public JTabbedPane getTabbedPane() - { - return tabbedPane; - } - - public void fireLanguageChanged() - { - verbinden = parent.getLanguageString("language.buttons.connect"); - trennen = parent.getLanguageString("language.buttons.disconnect"); - createConnection.removeActionListener(disconnectActionListener); - ActionListener[] listener = createConnection.getActionListeners(); - boolean found = false; - - for(int i = 0; i < listener.length; i++) - { - if(listener[i] == connectActionListener) - { - found = true; - createConnection.setText(verbinden); - break; - } - } - - if(!found) - { - createConnection.setText(trennen); - } - - newUserAction.setText(parent.getLanguageString("language.buttons.private")); - joinChannelAction.setText(parent.getLanguageString("language.buttons.join")); - changeNickAction.setText(parent.getLanguageString("language.buttons.nick")); - connectButton.setText(parent.getLanguageString("language.buttons.connect")); - cancelButton.setText(parent.getLanguageString("language.buttons.cancel")); - connectionInfo = parent.getLanguageString("language.title.newconnection"); - nicknameString = parent.getLanguageString("language.nick.newnick"); - channelNameString = parent.getLanguageString("language.channel.newchannel"); - for(int i = 0; i < tabbedPane.getComponentCount(); i++) - { - Object obj = tabbedPane.getComponent(i); - - if(obj.getClass() == ChannelPanel.class) - { - ((ChannelPanel) obj).fireLanguageChanged(); - } - } - } - - public void connectStartRegister() - { - try - { - connect(); - start(); - register(); - } - catch(IOException e) - { - tabUpdate("Init Window", "Connection refused to: " + host + ":" + port); - } - } - - private void makeConnectionInfo() - { - dialog = new JDialog(AppleJuiceDialog.getApp(), connectionInfo, true); - Container dialogContentPane = dialog.getContentPane(); - - // Ok, let's make the UserInfo - JPanel userInfo = new JPanel(new FlowLayout(FlowLayout.LEFT)); - JLabel label1 = new JLabel("Nickname: "); - - nickJTextField1 = new JTextField(25); - nickJTextField1.addKeyListener(new KeyAdapter() - { - public void keyReleased(KeyEvent ke) - { - super.keyReleased(ke); - if(nickJTextField1.getText().length() != 0) - { - connectButton.setEnabled(true); - if(ke.getKeyChar() == KeyEvent.VK_ENTER) - { - connectButton.doClick(); - } - } - else - { - connectButton.setEnabled(false); - } - } - }); - userInfo.add(label1); - userInfo.add(nickJTextField1); - String nick = parent.getProperties().getProperty("nick"); - - if(nick != null) - { - nickname = nick; - } - - if(nickname != null && nickname.length() > 0) - { - nickJTextField1.setText(nickname); - } - else - { - Random random = new Random(); - - nickJTextField1.setText("ajPluginUser" + Integer.toString(random.nextInt(99999))); - } - - connectButton.setEnabled(true); - - JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - // Action Listener - connectButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - - // OK, let's set the nickname if user has mentioned it - if(nickJTextField1.getText().length() == 0) - { - dialog.dispose(); - return; - } - - if(nickJTextField1.getText() != null) - { - setNickname(nickJTextField1.getText()); - } - - if(nickJTextField1.getText() == null) - { - Random random = new Random(); - - setNickname("ajPlugin" + Integer.toString(random.nextInt(99999))); - } - - connectButton.setEnabled(false); - createConnection.setEnabled(false); - connectStartRegister(); - createConnection.setText(trennen); - createConnection.removeActionListener(connectActionListener); - createConnection.addActionListener(disconnectActionListener); - createConnection.setEnabled(true); - dialog.dispose(); - } - }); - cancelButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if(dialog != null) - { - dialog.dispose(); - dialog = null; - } - } - }); - - buttonPanel.add(connectButton); - buttonPanel.add(cancelButton); - - dialogContentPane.add("North", userInfo); - dialogContentPane.add("South", buttonPanel); - - dialog.pack(); - dialog.setLocationRelativeTo(this); - dialog.setVisible(true); - } - - private void connect() throws IOException - { - doJoin = false; - first = true; - String propHost = parent.getProperties().getProperty("host"); - - if(propHost != null && propHost.length() > 0) - { - host = propHost; - } - - tabUpdate("Init Window", " Connecting to: " + host); - String propPort = parent.getProperties().getProperty("port"); - - if(propPort != null && propPort.length() > 0) - { - try - { - int tmpPort = Integer.parseInt(propPort); - - port = tmpPort; - } - catch(NumberFormatException nfE) - { - - //ungueltiger Port - } - } - - chatSocket = new Socket(host, port); - fromServer = new BufferedReader(new InputStreamReader(chatSocket.getInputStream())); - toServer = new PrintWriter(new OutputStreamWriter(chatSocket.getOutputStream())); - Component aComponent = tabbedPane.getComponentAt(0); - - ((InitPanel) aComponent).setTitleArea(nickname + " connected to: " + host + ":" + port); - } - - private void register() - { - realname = nickname; - - String propPass = parent.getProperties().getProperty("passwort"); - - if(propPass != null && propPass.length() > 0) - { - parseSendToCommand("PASS " + propPass); - } - - parseSendToCommand("NICK " + nickname); - parseSendToCommand("USER " + nickname + " 0 * :" + realname); - - new Thread() - { - public void run() - { - int count = 0; - - while(!isInterrupted() && count < 60) - { - try - { - sleep(500); - } - catch(InterruptedException ex) - { - interrupt(); - } - - if(doJoin) - { - if(toServer != null) - { - joinChannel(STANDARD_CHANNEL); - String onJoin = parent.getProperties().getProperty("onjoin"); - - if(onJoin != null && onJoin.length() > 0) - { - if(onJoin.charAt(0) == '/') - { - onJoin = onJoin.substring(1); - } - - parseSendToCommand(onJoin); - } - - String onJoinChannels = parent.getProperties().getProperty("channels"); - - if(onJoinChannels != null && onJoinChannels.length() > 0) - { - onJoinChannels(onJoinChannels); - } - } - - doJoin = false; - break; - } - - count++; - } - } - }.start(); - } - - private void onJoinChannels(String onJoinChannels) - { - String[] channels = onJoinChannels.split(","); - - for(int i = 0; i < channels.length; i++) - { - parseSendToCommand("JOIN " + channels[i]); - } - } - - // sends back your current nickname - public String getNickname() - { - return nickname; - } - - // setNickname sets your current nickname - public void setNickname(String nickname) - { - this.nickname = nickname; - } - - public void changeNickname(String oldNickname, String newNickname) - { - int totalTabs = tabbedPane.getTabCount(); - - for(int i = 0; i < totalTabs; i++) - { - Component aComponent = tabbedPane.getComponentAt(i); - - if(aComponent instanceof ChannelPanel) - { - - // Do channel processing - // At first remove the old nickname from the userNameBox - ((ChannelPanel) aComponent).renameUser(oldNickname, newNickname); - } - else if(aComponent instanceof UserPanel) - { - ; - - // Do UserPanel processing - // Actually this process was done in the NICK handling part.... - } - } - } - - public String formatNickname(String nickname) - { - return formatNickname(nickname, true); - } - - public String formatNickname(String nickname, boolean allignLeft) - { - int maxLength = 20; - String blank = ""; - int len = nickname.length(); - - if(len >= maxLength) - { - nickname = nickname.substring(0, maxLength); - } - else - { - for(int i = len; i < maxLength; i++) - { - nickname += " "; - } - } - - if(allignLeft) - { - return nickname + "\t"; - } - else - { - return "\t" + nickname; - } - } - - public String getRealname() - { - return realname; - } - - public void start() - { - if(ircWorker != null) - { - ircWorker.interrupt(); - ircWorker = null; - } - - ircWorker = new Thread() - { - public void run() - { - try - { - while(!isInterrupted()) - { - if(fromServer == null) - { - try - { - sleep(5000); - continue; - } - catch(InterruptedException e) - { - interrupt(); - } - } - - String line = null; - - try - { - line = fromServer.readLine(); - } - catch(InterruptedIOException se) - { - - // Timeout vom Socket - try - { - sleep(1500); - continue; - } - catch(InterruptedException e) - { - // nothing to do - line = null; - } - } - catch(SocketException se) - { - line = null; - } - - if(line != null) - { - parseFromServer(line); - } - else - { - // a null line indicates that our server has - // closed the connection - tabUpdate("Init Window", "Server closed the connection or network is fucked."); - closeAll(); - createConnection.setText(verbinden); - createConnection.removeActionListener(disconnectActionListener); - createConnection.addActionListener(connectActionListener); - createConnection.setEnabled(true); - break; - } - } - } - - catch(IOException e) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error("Unbehandelte Exception", e); - } - } - } - }; - ircWorker.start(); - } - - public void closeAll() - { - try - { - chatSocket.close(); - fromServer.close(); - toServer.close(); - } - catch(Exception e) - { - - //egal, weg ist weg... - } - - chatSocket = null; - fromServer = null; - toServer = null; - closeAllChannels(); - } - - public synchronized void parseFromServer(String lineFromServer) - throws IOException - { - myParser parser = new myParser(lineFromServer); - String command = parser.getCommand(); - - if(command.equals("PING") && first) - { - first = false; - parseSendToCommand("PONG :" + parser.getTrailing()); - doJoin = true; - } - else if(command.equals("MODE") && first) - { - doJoin = true; - first = false; - } - else if(command.equals("JOIN")) - { - String channelName = parser.getTrailing(); - - if(channelName.startsWith("#")) - { - channelName = channelName.substring(1); - int indexOfChannel = findTab(tabbedPane, "#" + channelName); - - if(indexOfChannel == -1) - { // Channel Tab doesn't exist - ChannelPanel channel = addChannel(tabbedPane, channelName); - - indexOfChannel = findTab(tabbedPane, "#" + channelName); - tabbedPane.setSelectedIndex(indexOfChannel); - channel.updateTextArea("*** Now talking in: " + parser.getTrailing()); - } - else - { // channelName tab exists! - ChannelPanel channel = (ChannelPanel) tabbedPane.getComponentAt(indexOfChannel); - - channel.updateTextArea("---> JOIN: " + parser.getNick() + " (" + parser.getUser() + "@" + parser.getHost() + ")"); - channel.updateUserArea(parser.getNick(), "add"); - } - } - } - else if(command.equals("PRIVMSG")) - { - - // handle PRIVMSG - String destination = parser.getMiddle(); - - if(destination.startsWith("#")) - { - - // it's a channel! - String channelName = destination.substring(1); - - // MSG Received....! - int indexOfChannel = findTab(tabbedPane, destination); - - if(indexOfChannel != -1) - { // A connection/tab already exists! - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - String trailing; - String nick; - - nick = parser.getNick(); - trailing = parser.getTrailing(); - if(trailing.indexOf(1) != -1) - { //is this a CTCP - //remove \001 from Beginning and End of CTCP msg - trailing = trailing.substring(1, trailing.length() - 1); - String message = trailing.replaceFirst("ACTION", nick); - - ((ChannelPanel) aComponent).updateTextArea("* " + message); - } - else if(nick.equals(nickname)) - { - - //((ChannelPanel)aComponent).textArea.setDisabledTextColor(new Color(255,0,0)); - ((ChannelPanel) aComponent).updateTextArea(formatNickname("<" + nick + "> ") + trailing); - } - else - { - - //((ChannelPanel)aComponent).textArea.setDisabledTextColor(new Color(0,0,255)); - ((ChannelPanel) aComponent).updateTextArea(formatNickname("<" + nick + "> ") + trailing); - } - } - } - else - { // A connection/tab doesn't exists, so create one! - ChannelPanel channel = addChannel(tabbedPane, channelName); - - channel.updateTextArea(formatNickname("<" + parser.getNick() + "> ") + "> " + parser.getTrailing()); - } - } //if (destination.startsWith("#")) - else - { //if (!destination.equalsIgnoreCase(getNickname())) - // it's from a user - int indexOfUser = findTab(tabbedPane, parser.getNick()); - - if(indexOfUser == -1) - { - UserPanel userPanel = addUser(tabbedPane, parser.getNick()); //if tab doesnt exist - // Add the real username@hostname in title of tabbedPane - - userPanel.setTitleArea(parser.getNick() + "!" + parser.getUser() + "@" + parser.getHost()); - } - - indexOfUser = findTab(tabbedPane, parser.getNick()); - - if(indexOfUser != -1) - { // A user connection/tab already exists! - Component aComponent = tabbedPane.getComponentAt(indexOfUser); - UserPanel userPanel = (UserPanel) aComponent; - - if(aComponent instanceof UserPanel) - { - String ctcpCommand; - String trailing; - char firstOne = 1; - - trailing = parser.getTrailing(); - if(trailing.indexOf(1) != -1) - { //is this a CTCP - if(trailing.indexOf(" ") != -1) - { - ctcpCommand = trailing.substring(1, trailing.indexOf(" ")); - } - else - { - ctcpCommand = trailing.substring(1, trailing.indexOf(1, 2)); - } - - if(ctcpCommand.equalsIgnoreCase("PING")) - { - parseSendToCommand("NOTICE " + parser.getNick() + " " + trailing); - } - - else if(ctcpCommand.equalsIgnoreCase("VERSION")) - { - String versionReply = "NOTICE " + parser.getNick() + " " + firstOne + ctcpCommand + - " Using ajPlugin IRC:v" + parent.getVersion() + ":Java" + firstOne; - - parseSendToCommand(versionReply); - - } - - userPanel.updateTextArea(formatNickname("��� � CTCP " + ctcpCommand + " received from " + - parser.getNick())); - } // if (trailing.indexOf(1) != -1) //is this a CTCP - - else - { // regular privmsg - userPanel.updateTextArea(formatNickname("<" + parser.getNick() + "> ") + trailing); - } - } //if (aComponent instanceof UserPanel) - } // if (indexOfUser != -1) - } // else (Msg from a user..) - } //else if (command.equals("PRIVMSG")) - - else if(command.equals("PART")) - { - - // Let's grab the channel name - String channelName = parser.getParams(); - int index = channelName.indexOf("#"); - int index2 = channelName.indexOf(":"); - - if(index2 != -1) - { - channelName = channelName.substring(index, index2 - 1); - } - else - { - channelName = channelName.substring(index); - } - - if(channelName.startsWith("#")) - { - channelName = channelName.substring(1); - - int indexOfChannel = findTab(tabbedPane, "#" + channelName); - - if(indexOfChannel != -1) - { // Tab doesn't exist. Do nothing - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - ((ChannelPanel) aComponent).updateTextArea("<--- PART: " + parser.getNick()); - ((ChannelPanel) aComponent).updateUserArea(parser.getNick(), "remove"); - } - - // Ok, let's remove the tab if the user who left the channel is you - if(parser.getNick().equals(getNickname())) - { - tabbedPane.removeTabAt(indexOfChannel); - } - } - } - } - else if(command.equals("QUIT")) - { - - //Find what channel user is on and direct Quit msg to correct channel(s) - boolean hide = parser.getTrailing().toLowerCase().indexOf("z:lined") != -1; - int index = findTab(tabbedPane, parser.getNick()); - - if(index != -1) - { - Object tab = tabbedPane.getComponentAt(index); - - if(tab.getClass() == UserPanel.class) - { - ((UserPanel) tab).userQuits(parser.getNick()); - } - } - - for(int i = 1; i < tabbedPane.getTabCount(); i++) - { - Object tab = tabbedPane.getComponentAt(i); - - if(tab.getClass() == ChannelPanel.class) - { - ((ChannelPanel) tab).userQuits(parser.getNick(), hide); - } - } - - if(hide) - { - tabUpdate("Init Window", parser.getNick() + " has quit (" + parser.getTrailing() + ")"); - } - } - else if(command.equals("NICK")) - { - - // handle NICK --- When a user changes its nickname - int index = findTab(tabbedPane, parser.getNick()); - - if(index != -1) - { - // setting the user tab title to changed nickname - tabbedPane.setTitleAt(index, parser.getTrailing()); - - // Let's change the name of the UserPanel alsow - UserPanel temp = (UserPanel) tabbedPane.getComponentAt(index); - - temp.setName(parser.getTrailing()); - } - - if(parser.getNick().equalsIgnoreCase(getNickname())) - { - setNickname(parser.getTrailing()); - } - - // When a user changes his/her name, his name in every - // UserPanel or ChannelPanel should be changed too. - // So, we are doing it now --- here - String oldNickname = parser.getNick(); - String newNickname = parser.getTrailing(); - - changeNickname(oldNickname, newNickname); - } - else if(command.equals("NOTICE")) - { - tabUpdate("Init Window", "NOTICE FROM: " + parser.getNick() + " ---> " + parser.getTrailing()); - Object reiter; - - for(int i = 1; i < tabbedPane.getTabCount(); i++) - { - reiter = tabbedPane.getComponentAt(i); - if(reiter.getClass() == ChannelPanel.class) - { - ((ChannelPanel) reiter).updateTextArea(formatNickname(">" + parser.getNick() + "< ") + parser.getTrailing()); - } - } - } - else if(command.equals("KICK")) - { - - // handle KICK - String kickedNick; - String kickedChannel; - String temp; - - temp = parser.getMiddle(); - kickedChannel = temp.substring(0, temp.indexOf(" ")); - kickedNick = temp.substring(temp.indexOf(" ") + 1, temp.length()); - int indexOfChannel = findTab(tabbedPane, kickedChannel); - ChannelPanel channel = (ChannelPanel) tabbedPane.getComponentAt(indexOfChannel); - - if(!(kickedNick.equals(getNickname()))) - { - channel.updateTextArea("<- KICK: " + kickedNick + " by " + parser.getNick() + " (" + parser.getTrailing() + ")"); - channel.updateUserArea(kickedNick, "remove"); - } - else - { // You have been kicked... - tabbedPane.removeTabAt(indexOfChannel); - tabUpdate("Init Window", - "You have been kicked from " + kickedChannel + " by " + parser.getNick() + " because " + - parser.getTrailing()); - } - } - else if(command.equals("001") || // RPL_WELCOME - command.equals("002") || // RPL_YOURHOST - command.equals("003") || // RPL_CREATED - command.equals("004")) - { // RPL_MYINFO - // successful registration - tabUpdate("Init Window", parser.getTrailing()); - } - else if(command.equals("250") || command.equals("251") || command.equals("253") || command.equals("255") || - command.equals("256") || command.equals("257") || command.equals("258") || command.equals("259") || - command.equals("265") || command.equals("266")) - { - tabUpdate("Init Window", parser.getTrailing()); - } - - //252 & 254 = num IRCOP and Total Channels - else if(command.equals("252")) - { - String numThing; - - numThing = lineFromServer.substring(lineFromServer.indexOf("252") + 5 + nickname.length(), lineFromServer.indexOf(":", 2)); - tabUpdate("Init Window", numThing + " " + parser.getTrailing()); - } - - else if(command.equals("254")) - { - String numThing; - - numThing = lineFromServer.substring(lineFromServer.indexOf("254") + 5 + nickname.length(), lineFromServer.indexOf(":", 2)); - tabUpdate("Init Window", numThing + " " + parser.getTrailing()); - } - - //channel full, invite only or need a key - else if(command.equals("471") || command.equals("473") || command.equals("475")) - { - String channel; - - channel = lineFromServer.substring(lineFromServer.indexOf("#"), lineFromServer.indexOf(":", 2)); - tabUpdate("Init Window", parser.getTrailing() + " (" + channel + ")"); - } - - /* else if (command.equals("371") || - command.equals("372") || - command.equals("374") || - command.equals("375") || - command.equals("376") - ) - { - tabUpdate("Init Window", "371-376 " + parser.getTrailing()); - tabUpdate("Init Window", "Skipping MOTD!"); - }*/ - else if(command.equals("311") // RPL_WHOISUSER - ) - { - - // Ok, let's see how we can process PROCESS - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - - //StringTokenizer st = new StringTokenizer(parser.getParams(), " "); - String whoNick = ""; - - //StringTokenizer st = new StringTokenizer(parser.getParams(), " "); - String whoUser = ""; - - //StringTokenizer st = new StringTokenizer(parser.getParams(), " "); - String whoHost = ""; - - //StringTokenizer st = new StringTokenizer(parser.getParams(), " "); - String whoMode = ""; - - //StringTokenizer st = new StringTokenizer(parser.getParams(), " "); - String whoRealName = ""; - - for(int i = 0; st.hasMoreTokens();) - { - String aToken = st.nextToken(); - - if(i == 1) - { - whoNick = aToken; - } - else if(i == 2) - { - whoUser = aToken; - } - else if(i == 3) - { - whoHost = aToken; - } - else if(i == 4) - { - whoMode = aToken; - } - else if(i == 5) - { - - //� v�rifier!!!!!!!!!!!!!! - String paramsWhois = parser.getParams(); - - whoRealName = paramsWhois.substring(paramsWhois.indexOf(aToken) + 1, paramsWhois.length()); - - //whoRealName = aToken.substring(1); - } - - i++; - } - - // Let's show the messages in the Init Window - tabUpdate("Init Window", "Whois info for " + whoNick); - tabUpdate("Init Window", " " + whoNick + "!" + whoUser + "@" + whoHost + " " + whoRealName); - } - else if(command.equals("312")) - { - String whoNick = ""; - String whoServer = ""; - String whoServerInfo = ""; - - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - - for(int i = 0; st.hasMoreTokens();) - { - String aToken = st.nextToken(); - - if(i == 1) - { - whoNick = aToken; - } - else if(i == 2) - { - whoServer = aToken; - } - else if(i == 3) - { - - //� v�rifier!!!!!!!!!!!!!! ainsi que whois realname - String paramsWhois = parser.getParams(); - - whoServerInfo = paramsWhois.substring(paramsWhois.indexOf(aToken) + 1, paramsWhois.length()); - - //whoServerInfo = aToken.substring(aToken.length()); - } - - i++; - } - - // Let's update the Init Window - tabUpdate("Init Window", " Server: " + whoServer + " " + whoServerInfo); - } - else if(command.equals("313")) - { - tabUpdate("Init Window", " Operator: " + lineFromServer); - } - else if(command.equals("317")) - { - String seconds = ""; - String trailing = ""; - - trailing = parser.getTrailing(); - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - - for(int i = 0; st.hasMoreTokens();) - { - String aToken = st.nextToken(); - - if(i == 2) - { - seconds = aToken; - break; - } - - i++; - } - - tabUpdate("Init Window", " Idle time: " + seconds + " " + trailing); - } - else if(command.equals("318")) - { - tabUpdate("Init Window", parser.getTrailing()); - } - else if(command.equals("319")) - { - tabUpdate("Init Window", " Channels: " + parser.getTrailing()); - } - else if(command.equals("301")) - { // RPL_AWAY - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - String awayNickname = ""; - - for(int i = 0; st.hasMoreTokens();) - { - String aToken = st.nextToken(); - - if(i == 1) - { - awayNickname = aToken; - break; - } - - i++; - } - - tabUpdate("Init Window", awayNickname + " is away for \"" + parser.getTrailing() + "\""); - } - else if(command.equals("305")) - { // RPL_UNAWAY - ; - } - - else if(command.equals("333")) - { // RPL_UNAWAY - ; - } - - // used or not ??????? - else if(command.equals("332") // RPL_TOPIC - ) - { - String topicChannelName = ""; - - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - - for(int i = 0; st.hasMoreTokens();) - { - String aToken = st.nextToken(); - - if(i == 1) - { - topicChannelName = aToken; - break; - } - - i++; - } - - int indexOfChannel = findTab(tabbedPane, topicChannelName); - - if(indexOfChannel != -1) - { - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - ((ChannelPanel) aComponent).setTitleArea(parser.getTrailing()); - } - } - } - else if(command.equals("TOPIC")) - { - String topicChannelName = ""; - - StringTokenizer st = new StringTokenizer(parser.getParams(), " \r\n"); - - if(st.hasMoreTokens()) - { - topicChannelName = st.nextToken(); - - } - - int indexOfChannel = findTab(tabbedPane, topicChannelName); - - if(indexOfChannel != -1) - { - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - ((ChannelPanel) aComponent).setTitleArea(parser.getTrailing()); - ((ChannelPanel) aComponent).updateTextArea("TOPIC: " + parser.getTrailing() + "(" + parser.getNick() + ")"); - } - } - } - else if(command.equals("353") // - ) - { - String channelName = parser.getMiddle(); - int index = channelName.lastIndexOf("#"); - - channelName = channelName.substring(index); - - // Find the tab of channelName - int indexOfChannel = findTab(tabbedPane, channelName); - - // If the channelName tab exists! - if(indexOfChannel != -1) - { - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - - // All the usernames are in trailing! - String trailing = parser.getTrailing(); - - // let's split those usernames with StringTokenizer - StringTokenizer st = new StringTokenizer(trailing, " \r\n"); - - // How many users are there? - int totalTokens = st.countTokens(); - - for(int i = 0; i < totalTokens; i++) - { - - // a username/nickname - String tempnickname = st.nextToken(); - - // Add that username to channelPanel's usernameBox - ((ChannelPanel) aComponent).updateUserArea(tempnickname, "add"); - } - } - } - else - { // channelName tab doesn't exist! - ; - } - } - - else if(command.equals("404")) - { - tabUpdate("Init Window", "ERROR: Cannot send msg to channel! " + lineFromServer); - } - - else if(command.equals("421")) - { - tabUpdate("Init Window", "ERROR: Command not found! " + lineFromServer); - } - - else if(command.equals("442")) - { - tabUpdate("Init Window", "ERROR: You're not on that channel! " + lineFromServer); - } - - else if(command.equals("443")) - { - tabUpdate("Init Window", "ERROR: User is already on that channel! " + lineFromServer); - } - - else if(command.equals("461")) - { - tabUpdate("Init Window", "ERROR: Need more params for this command! " + lineFromServer); - } - - else if(command.equals("482")) - { - tabUpdate("Init Window", "ERROR: You must be channel operator for this! " + lineFromServer); - } - - else if(command.equals("433")) - { - tabUpdate("Init Window", nickname + " already in use " + parser.getTrailing()); - - String newNickname; - - newNickname = JOptionPane.showInputDialog(nicknameString, nickname); - - if(newNickname != null) - { - nickname = newNickname; - Component aComponent = tabbedPane.getComponentAt(0); - - ((InitPanel) aComponent).setTitleArea(newNickname + " connected to: " + host + ":" + port); - parseSendToCommand("NICK " + newNickname); - } - } - else - { - if(lineFromServer.indexOf("MODE") != -1) - { - String nickCommand; - String modeReceiver; - String modeReceived; - String temp; - String channelsMode; - - //:UP^!UP@phpaj.de.vu MODE #applejuice +vvv ajPluginUser27667 ajPluginUser6848 ajPluginUser89142 - temp = lineFromServer.substring(1, lineFromServer.indexOf(" ")); - nickCommand = temp; - if(temp.indexOf("!") != -1) - { - nickCommand = temp.substring(0, temp.indexOf("!")); - } - - temp = lineFromServer.substring(lineFromServer.indexOf(" ", lineFromServer.indexOf(" ") + 1)); - temp = temp.substring(temp.indexOf(" ")); - - // User mode - if(temp.indexOf(":") != -1) - { - modeReceiver = temp.substring(0, temp.indexOf(":") - 1); - modeReceived = temp.substring(temp.indexOf(":") + 1); - tabUpdate("Init Window", nickCommand + " sets MODE: " + modeReceived + " " + modeReceiver); - } - - // Channel mode - else - { - channelsMode = temp.substring(1, temp.indexOf(" ", 1)); - modeReceived = temp.substring(temp.indexOf(" ", 1) + 1, temp.length()); - int indexOfChannel = findTab(tabbedPane, channelsMode); - - if(indexOfChannel != -1) - { - Component aComponent = tabbedPane.getComponentAt(indexOfChannel); - - if(aComponent instanceof ChannelPanel) - { - ChannelPanel channel = (ChannelPanel) aComponent; - - //MeineR sets MODE: +vvv bluna Biggestking ajPluginUser23249 - char plusMinus = modeReceived.charAt(0); - String tmp = modeReceived.substring(1, modeReceived.indexOf(" ")); - String names = modeReceived.substring(modeReceived.indexOf(" ") + 1); - String[] splits = names.split(" "); - - if((plusMinus == '-' || plusMinus == '+')) - { - char mode = modeReceived.charAt(1); - - if(mode == 'v' || mode == 'a' || mode == 'o' || mode == 'h') - { - for(int i = 0; i < splits.length; i++) - { - String name = splits[i]; - User[] users = channel.getUserNameList().getValues(); - - for(int x = 0; x < users.length; x++) - { - if(users[x].getName().equalsIgnoreCase(name)) - { - if(mode == 'v') - { - users[x].setVoice(plusMinus == '+'); - } - else if(mode == 'a') - { - users[x].setAdmin(plusMinus == '+'); - } - else if(mode == 'o') - { - users[x].setOp(plusMinus == '+'); - } - else if(mode == 'h') - { - users[x].setHalfop(plusMinus == '+'); - } - - channel.getUserNameList().reorder(); - break; - } - } - } - } - } - - channel.updateTextArea(nickCommand + " sets MODE: " + modeReceived); - } - } - } - } - else if(lineFromServer.indexOf(" 366 ") != -1) - { - ; - } - else - { - tabUpdate("Init Window", lineFromServer); - } - } - } - - private int findTab(final JTabbedPane tabbedPane, String title) - { - int totalTabs = tabbedPane.getTabCount(); - - for(int i = 0; i < totalTabs; i++) - { - String tabTitle = tabbedPane.getTitleAt(i); - - // Let's see whether tabbedPane title and title matches! - if(tabTitle.equalsIgnoreCase(title)) - { - return i; - } - } - - // Not found anything? Return -1 - return -1; - } - - private int tabUpdate(String tabTitle, String message) - { - int indexOfTab = findTab(tabbedPane, tabTitle); - - if(indexOfTab != -1) - { - Component aComponent = tabbedPane.getComponentAt(indexOfTab); - - if(aComponent.getClass() == ChannelPanel.class) - { - ((ChannelPanel) aComponent).updateTextArea(message); - } - else if(aComponent.getClass() == UserPanel.class) - { - ((UserPanel) aComponent).updateTextArea(message); - } - else if(aComponent.getClass() == InitPanel.class) - { - ((InitPanel) aComponent).updateTextArea(message); - } - } - - return indexOfTab; - } - - public void parseSendToCommand(String lineToServer) - { - - // At first let's see whether the connection is still alive or - // not. - if(toServer != null) - { - toServer.print(lineToServer + "\r\n"); - toServer.flush(); - if(lineToServer.toLowerCase().indexOf("join #" + STANDARD_CHANNEL) != -1) - { - String norules = parent.getProperties().getProperty("norules"); - - if(norules == null || norules.compareToIgnoreCase("true") != 0) - { - RulesDialog rulesDialog = new RulesDialog(AppleJuiceDialog.getApp(), true); - - rulesDialog.setVisible(true); - } - } - } - } - - private JTabbedPane createTabbedPane() - { - JTabbedPane tabbedPane = new JTabbedPane(); - - // Adding the init window - tabbedPane.add(new InitPanel(this), "Init Window"); - return tabbedPane; - } - - private void newUser() - { - String userName; - - userName = JOptionPane.showInputDialog(theApp, nicknameString, nickname); - - if(userName != null) - { - addUser(tabbedPane, userName); - } - } - - private void joinChan() - { - String channelName; - - channelName = JOptionPane.showInputDialog(theApp, channelNameString); - joinChannel(channelName); - } - - private void joinChannel(String channel) - { - if(channel != null) - { - if(channel.startsWith("#")) - { - tabUpdate("Init Window", "Trying to join: " + channel); - if(toServer != null) - { - parseSendToCommand("JOIN " + channel); - } - } - else - { - tabUpdate("Init Window", "Trying to join: #" + channel); - if(toServer != null) - { - parseSendToCommand("JOIN #" + channel); - } - } - } - else - { - tabUpdate("Init Window", "No channel name specified."); - } - } - - private void changeNick() - { - String newNickname; - - newNickname = JOptionPane.showInputDialog(theApp, nicknameString, nickname); - - if(newNickname != null) - { - if(newNickname.length() > 30) - { - newNickname = newNickname.substring(0, 30); - } - - if(toServer != null) - { - Component aComponent = tabbedPane.getComponentAt(0); - - ((InitPanel) aComponent).setTitleArea(newNickname + " connected to: " + host + ":" + port); - parseSendToCommand("NICK " + newNickname); - nickname = newNickname; - } - } - } - - private void whois() - { - String whoisNickname; - - whoisNickname = JOptionPane.showInputDialog(theApp, nicknameString); - - if(whoisNickname != null && toServer != null) - { - parseSendToCommand("WHOIS " + whoisNickname); - } - } - - public UserPanel addUser(final JTabbedPane tabbedPane, String name) - { - UserPanel userPanel = new UserPanel(this, name, tabbedPane); - - tabbedPane.add(userPanel, name); - tabbedPane.revalidate(); - - return userPanel; - } - - private ChannelPanel addChannel(final JTabbedPane tabbedPane, String name) - { - ChannelPanel channel; - - if(name.startsWith("#")) - { - channel = new ChannelPanel(this, name, tabbedPane); - tabbedPane.add(channel, name); - } - else - { - channel = new ChannelPanel(this, "#" + name, tabbedPane); - tabbedPane.add(channel, "#" + name); - } - - tabbedPane.revalidate(); - - return channel; - } - - public JTabbedPane closeChannel(final JTabbedPane tabbedPane, String name) - { - int index; - - index = tabbedPane.indexOfTab(name); - - if(index != -1 && index >= 0) - { - tabbedPane.removeTabAt(index); - } - - tabbedPane.revalidate(); - return tabbedPane; - } - - public JTabbedPane closeAllChannels() - { - int count = tabbedPane.getTabCount(); - - for(int i = count - 1; i > 0; i--) - { - tabbedPane.removeTabAt(i); - } - - tabbedPane.revalidate(); - return tabbedPane; - } - - public void analyzeCommand(String message) - { - CommandInterpreter cmdI = new CommandInterpreter(message); - - if(cmdI.getCommand().equals("JOIN")) - { - parseSendToCommand(cmdI.getCommand() + " " + cmdI.getParam1() + " " + cmdI.getMessage()); - } - else if(cmdI.getCommand().equals("PART") || cmdI.getCommand().equals("LEAVE")) - { - parseSendToCommand("PART " + cmdI.getParam1() + " :" + cmdI.getMessage()); - } - else if(cmdI.getCommand().equals("QUIT")) - { - parseSendToCommand("QUIT :" + cmdI.getParam1() + " " + cmdI.getMessage()); - } - else if(cmdI.getCommand().equals("WHOIS")) - { - parseSendToCommand("WHOIS " + cmdI.getParam1() + " " + cmdI.getMessage()); - } - else if(cmdI.getCommand().equals("MSG")) - { - parseSendToCommand("PRIVMSG " + cmdI.getParam1() + " :" + cmdI.getMessage()); - } - else if(cmdI.getCommand().equals("CTCP")) - { - parseSendToCommand("PRIVMSG " + cmdI.getParam1() + " :" + 1 + cmdI.getMessage() + 1); - } - else if(cmdI.getCommand().equals("NICK")) - { - parseSendToCommand("NICK " + cmdI.getParam1()); - } - else if(cmdI.getCommand().equals("TOPIC")) - { - if(cmdI.getMessage().equals("")) - { - parseSendToCommand(cmdI.getCommand() + " " + cmdI.getParam1() + " :"); - } - else - { - parseSendToCommand(cmdI.getCommand() + " " + cmdI.getParam1() + " :" + cmdI.getMessage()); - } - } - else - { - parseSendToCommand(cmdI.getCommand() + " :" + cmdI.getParam1() + " " + cmdI.getMessage()); - } - } - - private class ConnectActionListener implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - makeConnectionInfo(); - } - } - - - private class DisconnectActionListener implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - createConnection.setEnabled(false); - createConnection.setText(verbinden); - createConnection.removeActionListener(disconnectActionListener); - createConnection.addActionListener(connectActionListener); - closeAll(); - createConnection.setEnabled(true); - tabUpdate("Init Window", "Disconnected from: " + host + ":" + port); - } - } -} diff --git a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/myParser.java b/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/myParser.java deleted file mode 100644 index 00a30d90..00000000 --- a/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/myParser.java +++ /dev/null @@ -1,152 +0,0 @@ -package de.applejuicenet.client.gui.plugins.ircplugin; - -import java.util.*; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/ircplugin/src/de/applejuicenet/client/gui/plugins/ircplugin/myParser.java,v 1.4 2004/10/15 13:34:47 maj0r Exp $ - * - *

Titel: AppleJuice Client-GUI

- *

Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core

- *

Copyright: General Public License

- * - * @author: Maj0r - * - */ - -public class myParser { - String line; - String prefix = "", - command = "", - params = "", - middle = "", - trailing = "", - servername = "", - nick = "", - user = "", - host = ""; - - public myParser(String line) { - this.line = line; - initTags(); - } - - private void initTags() { - StringTokenizer st = new StringTokenizer(line, " \r\n"); - int totalTokens = st.countTokens(); - - if (line.startsWith(":") && totalTokens >= 3) - { - String temp = st.nextToken(); - int index = temp.indexOf(":"); - if (index != -1){ - prefix = temp.substring(index + 1); - } - - temp = st.nextToken(); - command = temp; - - temp = st.nextToken("\n"); - params = temp; - } - else if (!line.startsWith(":") && totalTokens >= 2) - { - String temp = st.nextToken(); - command = temp; - while (st.hasMoreTokens()){ - params = params + st.nextToken(); - } - } - } - - public String getPrefix() { - return prefix; - } - - public String getCommand() { - return command; - } - - public String getParams() { - return params; - } - - public String getServer() { - if (!prefix.equals("")) - { - int index = prefix.indexOf("!"); - if (index != -1) - { - String temp = prefix.substring(0, index); - servername = temp; - } - } - return servername; - } - - public String getNick() { - if (!prefix.equals("")) - { - int index = prefix.indexOf("!"); - if (index != -1) - { - String temp = prefix.substring(0, index); - nick = temp; - } - } - return nick; - } - - public String getUser() { - if (!prefix.equals("")) - { - int exMark = prefix.indexOf("!"); - int adMark = prefix.indexOf("@"); - if (exMark != -1 && adMark != -1 && (adMark > exMark)) - { - user = prefix.substring(exMark + 1, adMark); - } - } - return user; - } - - public String getHost() { - if (!prefix.equals("")) - { - int adMark = prefix.indexOf("@"); - if (adMark != -1 && adMark >= 0) - { - host = prefix.substring(adMark + 1); - } - } - return host; - } - - public String getTrailing() { - if (!params.equals("")) - { - int index = params.indexOf(":"); - if (index != -1 && index >= 0) - { - trailing = params.substring(index + 1); - } - } - return trailing; - } - - public String getMiddle() { - if (!params.equals("")) - { - int index = params.indexOf(":"); - if (index != -1 && index >= 0) - { - if (params.startsWith(" ") && index - 1 >= 1){ - middle = params.substring(1, index - 1); - } - else{ - middle = params.substring(0, index - 1); - } - } - } - return middle; - } -} diff --git a/AJClientGUI/plugin_src/jabber/icons/available.gif b/AJClientGUI/plugin_src/jabber/icons/available.gif deleted file mode 100644 index 7ae1d253..00000000 Binary files a/AJClientGUI/plugin_src/jabber/icons/available.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/icons/awk.gif b/AJClientGUI/plugin_src/jabber/icons/awk.gif deleted file mode 100644 index 3e0452e0..00000000 Binary files a/AJClientGUI/plugin_src/jabber/icons/awk.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/icons/icon.gif b/AJClientGUI/plugin_src/jabber/icons/icon.gif deleted file mode 100644 index f9d61f89..00000000 Binary files a/AJClientGUI/plugin_src/jabber/icons/icon.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/icons/offline.gif b/AJClientGUI/plugin_src/jabber/icons/offline.gif deleted file mode 100644 index 5257cc7e..00000000 Binary files a/AJClientGUI/plugin_src/jabber/icons/offline.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/lib/smack.jar b/AJClientGUI/plugin_src/jabber/lib/smack.jar deleted file mode 100644 index dfe9d842..00000000 Binary files a/AJClientGUI/plugin_src/jabber/lib/smack.jar and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/lib/smackx.jar b/AJClientGUI/plugin_src/jabber/lib/smackx.jar deleted file mode 100644 index 00eeeaeb..00000000 Binary files a/AJClientGUI/plugin_src/jabber/lib/smackx.jar and /dev/null differ diff --git a/AJClientGUI/plugin_src/jabber/plugin_properties.xml b/AJClientGUI/plugin_src/jabber/plugin_properties.xml deleted file mode 100644 index 692f5372..00000000 --- a/AJClientGUI/plugin_src/jabber/plugin_properties.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - <version value="1.0"/> - <author value="Maj0r"/> - <contact value="tkrall@tkl-soft.de"/> - <description value="Jabber-Plugin"/> - <istab value="true"/> - <classname value="de.applejuicenet.client.gui.plugins.jabber.JabberPlugin"/> - </general> -</root> diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberPlugin.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberPlugin.java deleted file mode 100644 index 2f404190..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberPlugin.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber; - -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Map; - -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.SwingUtilities; - -import org.apache.log4j.Logger; -import org.jivesoftware.smack.SmackConfiguration; -import org.jivesoftware.smack.XMPPConnection; -import org.jivesoftware.smack.XMPPException; -import org.jivesoftware.smackx.muc.MultiUserChat; - -import de.applejuicenet.client.fassade.controller.xml.XMLValueHolder; -import de.applejuicenet.client.gui.plugins.PluginConnector; -import de.applejuicenet.client.gui.plugins.jabber.control.IdentityController; -import de.applejuicenet.client.gui.plugins.jabber.control.MultiUserChatController; -import de.applejuicenet.client.gui.plugins.jabber.view.IdentityPanel; -import de.applejuicenet.client.gui.plugins.jabber.view.MultiUserChatListCellRenderer; -import de.applejuicenet.client.gui.plugins.jabber.view.RosterUserTreeCellRenderer; -import de.tklsoft.gui.controls.InvalidRule; -import de.tklsoft.gui.controls.ModifyableComponent; -import de.tklsoft.gui.controls.TKLPasswordField; -import de.tklsoft.gui.controls.TKLTextField; -import de.tklsoft.gui.controls.StatusHolder.STATUSFLAG; - -public class JabberPlugin extends PluginConnector -{ - private final String CMD_VERBINDEN = "Verbinden"; - private final String CMD_TRENNEN = "Trennen"; - private Logger logger; - private JButton connectButton = new JButton(CMD_VERBINDEN); - private TKLTextField user = new TKLTextField(15); - private TKLPasswordField passwort = new TKLPasswordField(); - private TKLTextField nickname = new TKLTextField(15); - private JTabbedPane tabbedPane = new JTabbedPane(); - private CardLayout registerLayout = new CardLayout(); - private JPanel registerPanel = new JPanel(registerLayout); - private XMPPConnection connection = null; - - public JabberPlugin(XMLValueHolder pluginsPropertiesXMLHolder, Map<String, XMLValueHolder> languageFiles, ImageIcon icon, - Map<String, ImageIcon> availableIcons) - { - super(pluginsPropertiesXMLHolder, languageFiles, icon, availableIcons); - SmackConfiguration.setPacketReplyTimeout(20000); - RosterUserTreeCellRenderer.available = getAvailableIcon("available"); - RosterUserTreeCellRenderer.offline = getAvailableIcon("offline"); - RosterUserTreeCellRenderer.awk = getAvailableIcon("awk"); - - MultiUserChatListCellRenderer.moderator = getAvailableIcon("available"); - MultiUserChatListCellRenderer.voice = getAvailableIcon("offline"); - MultiUserChatListCellRenderer.owner = getAvailableIcon("awk"); - MultiUserChatListCellRenderer.member = getAvailableIcon("awk"); - - logger = Logger.getLogger(getClass()); - initGUI(); - } - - private void initGUI() - { - user.addInvalidRule(InvalidRule.EmptyInvalidRule.getInstance()); - user.addInvalidRule(new InvalidRule() - { - public boolean isInvalid(ModifyableComponent comp) - { - String text = user.getText().trim(); - - if(text.length() <= 2) - { - return true; - } - - if(text.indexOf("@") == -1) - { - return true; - } - - if(text.indexOf(".") == -1 || text.endsWith(".")) - { - return true; - } - - return false; - } - }); - - passwort.setColumns(15); - // passwort.addInvalidRule(InvalidRule.EmptyInvalidRule.getInstance()); - nickname.addInvalidRule(InvalidRule.EmptyInvalidRule.getInstance()); - - user.ignoreInvalidRules(false); - nickname.ignoreInvalidRules(false); - - user.ignoreStatus(STATUSFLAG.MODIFIED, true); - // passwort.ignoreStatus(STATUSFLAG.MODIFIED, true); - nickname.ignoreStatus(STATUSFLAG.MODIFIED, true); - - user.fireCheckRules(); - nickname.fireCheckRules(); - - setLayout(new BorderLayout()); - JPanel buttonpanel = new JPanel(new FlowLayout()); - - buttonpanel.add(new JLabel("Benutzer:")); - buttonpanel.add(user); - buttonpanel.add(new JLabel("Passwort:")); - buttonpanel.add(passwort); - buttonpanel.add(new JLabel("Nickname:")); - buttonpanel.add(nickname); - buttonpanel.add(connectButton); - add(buttonpanel, BorderLayout.NORTH); - - if(System.getProperty("Debug") != null) - { - initForTest(); - } - - connectButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - doConnect(); - } - }); - - IdentityPanel identityPanel = IdentityController.getInstance().getPanel(); - - JSplitPane eastSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, identityPanel, registerPanel); - - eastSplitPane.setOneTouchExpandable(true); - - JSplitPane centerSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tabbedPane, eastSplitPane); - - centerSplitPane.setOneTouchExpandable(true); - centerSplitPane.setResizeWeight(1); - add(centerSplitPane, BorderLayout.CENTER); - } - - private boolean isInputValid() - { - user.fireCheckRules(); - nickname.fireCheckRules(); - - // password.fireCheckRules(); - if(user.isInvalid()) - { - return false; - } - - if(nickname.isInvalid()) - { - return false; - } - - return true; - } - - protected void doConnect() - { - if(!isInputValid()) - { - return; - } - - connectButton.setEnabled(false); - if(CMD_VERBINDEN.equals(connectButton.getText())) - { - user.setEnabled(false); - passwort.setEnabled(false); - nickname.setEnabled(false); - - // neue Verbindung aufbauen - String tmp = user.getText().trim(); - int index = tmp.indexOf("@"); - final String server = tmp.substring(index + 1); - - final String username = tmp.substring(0, index); - final String nick = nickname.getText().trim(); - - new Thread(new Runnable() - { - public void run() - { - try - { - connection = new XMPPConnection(server); - String password = new String(passwort.getPassword()); - - connection.login(username, password); - IdentityController.getInstance().setConnection(connection); - joinMultiUserChat("applejuice@conference.jabber.org", nick); - connectButton.setText(CMD_TRENNEN); - connectButton.setEnabled(true); - } - catch(XMPPException e) - { - e.printStackTrace(); - connectButton.setEnabled(true); - } - } - }).start(); - } - else - { - - // neue Verbindung trennen - if(null != connection) - { - new Thread(new Runnable() - { - public void run() - { - connection.close(); - connection = null; - IdentityController.getInstance().setConnection(null); - connectButton.setText(CMD_VERBINDEN); - user.setEnabled(true); - passwort.setEnabled(true); - nickname.setEnabled(true); - connectButton.setEnabled(true); - } - }).start(); - } - } - } - - private void initForTest() - { - user.setText("ajtest2@jabber.org"); - nickname.setText("ajtest2"); - user.fireCheckRules(); - nickname.fireCheckRules(); - } - - @Override - public void fireContentChanged(DATALISTENER_TYPE type, Object content) - { - } - - @Override - public void fireLanguageChanged() - { - } - - @Override - public void registerSelected() - { - } - - private void joinMultiUserChat(final String room, String nick) - throws XMPPException - { - MultiUserChat muc = new MultiUserChat(connection, room); - final MultiUserChatController multiUserChatController = new MultiUserChatController(muc, nick); - - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - tabbedPane.addTab(room, multiUserChatController.getMultiUserChatPanel()); - registerPanel.add(multiUserChatController.getRoomName(), multiUserChatController.getUserListPane()); - } - }); - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberTestLoader.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberTestLoader.java deleted file mode 100644 index e0d5b083..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/JabberTestLoader.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.applejuicenet.client.gui.plugins.jabber; - -import java.util.Map; - -import javax.swing.ImageIcon; - -import de.applejuicenet.client.fassade.controller.xml.XMLValueHolder; -import de.applejuicenet.client.gui.plugincontrol.TestLoader; -import de.applejuicenet.client.gui.plugins.PluginConnector; - -public class JabberTestLoader extends TestLoader -{ - @Override - protected String getPath() - { - return "jabber"; - } - - @Override - protected PluginConnector getPlugin(XMLValueHolder pluginsPropertiesXMLHolder, Map<String, XMLValueHolder> languageFiles, - ImageIcon icon, Map<String, ImageIcon> availableIcons) - { - return new JabberPlugin(pluginsPropertiesXMLHolder, languageFiles, icon, availableIcons); - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/IdentityController.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/IdentityController.java deleted file mode 100644 index db769019..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/IdentityController.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; - -import javax.swing.SwingUtilities; - -import org.jivesoftware.smack.Roster; -import org.jivesoftware.smack.RosterEntry; -import org.jivesoftware.smack.RosterGroup; -import org.jivesoftware.smack.RosterListener; -import org.jivesoftware.smack.XMPPConnection; -import org.jivesoftware.smack.packet.Presence; - -import de.applejuicenet.client.gui.plugins.jabber.control.rostertree.RosterTreeNode; -import de.applejuicenet.client.gui.plugins.jabber.view.IdentityPanel; -import de.applejuicenet.client.gui.plugins.jabber.view.RosterUserTreeCellRenderer; - -public class IdentityController -{ - private static IdentityController instance = null; - private XMPPConnection connection; - private IdentityPanel identityPanel = null; - private KnownUsersTreeModel knownUsersTreeModel = null; - - private IdentityController() - { - } - - public static synchronized IdentityController getInstance() - { - if(null == instance) - { - instance = new IdentityController(); - } - - return instance; - } - - public void setConnection(XMPPConnection aConnection) - { - connection = aConnection; - if(null == connection) - { - getKnownUsersTreeModel().getRootNode().removeAllChildren(); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - getPanel().getKnownUsersTree().updateUI(); - } - }); - } - else - { - final Roster roster = connection.getRoster(); - - new MyRosterListener(roster); - new Thread(new Runnable() - { - public void run() - { - RosterTreeNode rootNode = getKnownUsersTreeModel().getRootNode(); - - rootNode.setText(connection.getUser()); - rootNode.removeAllChildren(); - RosterGroup curGroup; - RosterEntry curRosterEntry; - RosterTreeNode groupNode; - RosterTreeNode rosterEntryNode; - String name; - - HashSet<String> allUsers = new HashSet<String>(); - Iterator it = roster.getEntries(); - - while(it.hasNext()) - { - curRosterEntry = (RosterEntry) it.next(); - allUsers.add(curRosterEntry.getName()); - } - - it = roster.getGroups(); - while(it.hasNext()) - { - curGroup = (RosterGroup) it.next(); - groupNode = new RosterTreeNode(curGroup.getName()); - - rootNode.insert(groupNode, 0); - Iterator it2 = curGroup.getEntries(); - - while(it2.hasNext()) - { - curRosterEntry = (RosterEntry) it2.next(); - name = curRosterEntry.getName(); - rosterEntryNode = new RosterTreeNode(name); - allUsers.remove(name); - groupNode.insert(rosterEntryNode, 0); - } - } - - if(allUsers.size() > 0) - { - groupNode = new RosterTreeNode("Sonstige"); - rootNode.insert(groupNode, rootNode.getChildCount()); - for(String curUser : allUsers) - { - rosterEntryNode = new RosterTreeNode(curUser); - - groupNode.insert(rosterEntryNode, 0); - } - } - - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - getPanel().getKnownUsersTree().updateUI(); - int count = getKnownUsersTreeModel().getRootNode().getChildCount(); - - for(int i = count - 1; i >= 0; i--) - { - getPanel().getKnownUsersTree().expandRow(i); - } - } - }); - } - }).start(); - } - } - - public IdentityPanel getPanel() - { - if(null == identityPanel) - { - identityPanel = new IdentityPanel(); - identityPanel.getKnownUsersTree().setModel(getKnownUsersTreeModel()); - - identityPanel.getKnownUsersTree().setCellRenderer(new RosterUserTreeCellRenderer()); - } - - return identityPanel; - } - - public KnownUsersTreeModel getKnownUsersTreeModel() - { - if(null == knownUsersTreeModel) - { - knownUsersTreeModel = new KnownUsersTreeModel(); - } - - return knownUsersTreeModel; - } - - private class MyRosterListener implements RosterListener - { - private final Roster roster; - - public MyRosterListener(Roster roster) - { - this.roster = roster; - roster.addRosterListener(this); - } - - public void entriesAdded(Collection arg0) - { - } - - public void entriesDeleted(Collection arg0) - { - } - - public void entriesUpdated(Collection arg0) - { - - // nichts zu tun - ; - } - - public void presenceChanged(String nick) - { - Presence presence = roster.getPresence(nick); - - nick = nick.substring(0, nick.indexOf("@")); - RosterTreeNode rootNode = getKnownUsersTreeModel().getRootNode(); - int count = rootNode.getChildCount(); - boolean found = false; - - for(int i = 0; i < count; i++) - { - RosterTreeNode child = (RosterTreeNode) rootNode.getChildAt(i); - - if(child.isLeaf()) - { - if(child.getText().equalsIgnoreCase(nick)) - { - child.setPresence(presence); - found = true; - } - } - else - { - int count2 = child.getChildCount(); - - for(int x = 0; x < count2; x++) - { - RosterTreeNode subChild = (RosterTreeNode) child.getChildAt(x); - - if(subChild.getText().equalsIgnoreCase(nick)) - { - subChild.setPresence(presence); - found = true; - break; - } - } - } - - if(found) - { - break; - } - } - - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - identityPanel.getKnownUsersTree().updateUI(); - } - }); - } - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/KnownUsersTreeModel.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/KnownUsersTreeModel.java deleted file mode 100644 index 657d6fc5..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/KnownUsersTreeModel.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.applejuicenet.client.gui.plugins.jabber.control; - -import javax.swing.tree.DefaultTreeModel; - -import de.applejuicenet.client.gui.plugins.jabber.control.rostertree.RosterTreeNode; - -public class KnownUsersTreeModel extends DefaultTreeModel -{ - public KnownUsersTreeModel() - { - super(new RosterTreeNode()); - } - - public RosterTreeNode getRootNode() - { - return (RosterTreeNode) getRoot(); - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/LinkEditorKit.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/LinkEditorKit.java deleted file mode 100644 index 18b160ce..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/LinkEditorKit.java +++ /dev/null @@ -1,139 +0,0 @@ -package de.applejuicenet.client.gui.plugins.jabber.control; - -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; - -import java.net.URL; - -import javax.swing.JEditorPane; -import javax.swing.SwingUtilities; -import javax.swing.event.HyperlinkEvent; -import javax.swing.text.Element; -import javax.swing.text.Position; -import javax.swing.text.StyledDocument; -import javax.swing.text.StyledEditorKit; - -public class LinkEditorKit extends StyledEditorKit -{ - public static final Object LINK = new StringBuffer("LINK"); - private static LinkHandler linkHandler = new LinkHandler(); - - public LinkEditorKit() - { - } - - public void install(JEditorPane p) - { - super.install(p); - p.addMouseListener(linkHandler); - p.addMouseMotionListener(linkHandler); - } - - public void deinstall(JEditorPane p) - { - p.removeMouseListener(linkHandler); - p.removeMouseMotionListener(linkHandler); - super.deinstall(p); - } - - private static class LinkHandler extends MouseAdapter implements MouseMotionListener - { - private Element activeElement; - - private Element characterElementAt(MouseEvent e) - { - JEditorPane p = (JEditorPane) e.getComponent(); - Position.Bias[] bias = new Position.Bias[1]; - int position = p.getUI().viewToModel(p, e.getPoint(), bias); - - if(bias[0] == Position.Bias.Backward && position != 0) - { - --position; - } - - Element c = ((StyledDocument) p.getDocument()).getCharacterElement(position); - - return c; - } - - public void mouseMoved(MouseEvent e) - { - JEditorPane p = (JEditorPane) e.getComponent(); - - if(!p.isEditable()) - { - Element c = characterElementAt(e); - Object target = c.getAttributes().getAttribute(LINK); - - if(!(target instanceof URL)) - { - target = null; - } - - if(target != null) - { - p.fireHyperlinkUpdate(new HyperlinkEvent(p, HyperlinkEvent.EventType.ENTERED, (URL) target, null, c)); - } - else - { - p.fireHyperlinkUpdate(new HyperlinkEvent(p, HyperlinkEvent.EventType.EXITED, (URL) target, null, c)); - } - } - } - - public void mouseDragged(MouseEvent e) - { - } - - public void mouseEntered(MouseEvent e) - { - } - - public void mousePressed(MouseEvent e) - { - if(!SwingUtilities.isLeftMouseButton(e)) - { - return; - } - - JEditorPane p = (JEditorPane) e.getComponent(); - - if(p.isEditable()) - { - return; - } - - Element c = characterElementAt(e); - - if(c != null && c.getAttributes().getAttribute(LINK) != null) - { - activeElement = c; - } - } - - public void mouseReleased(MouseEvent e) - { - if(!SwingUtilities.isLeftMouseButton(e) || activeElement == null) - { - return; - } - - JEditorPane p = (JEditorPane) e.getComponent(); - Element c = characterElementAt(e); - - if(!p.isEditable() && c == activeElement) - { - activeElement = null; - Object target = c.getAttributes().getAttribute(LINK); - - if(!(target instanceof URL)) - { - target = null; - } - - p.fireHyperlinkUpdate(new HyperlinkEvent(p, HyperlinkEvent.EventType.ACTIVATED, (URL) target, null, c)); - } - } - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiChatUserMode.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiChatUserMode.java deleted file mode 100644 index e836d66f..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiChatUserMode.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control; - -public enum MultiChatUserMode -{OWNER(0), MODERATOR(1), MEMBER(2), VOICE(3), NOTHING(4);private int value; - - MultiChatUserMode(int aValue) - { - value = aValue; - } - - public Integer getValue() - { - return value; - } - - public static MultiChatUserMode getByRole(String role) - { - if(role.equalsIgnoreCase("moderator")) - { - return MODERATOR; - } - else if(role.equalsIgnoreCase("member")) - { - return MEMBER; - } - else if(role.equalsIgnoreCase("participant")) - { - return VOICE; - } - else - { - return NOTHING; - } - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatController.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatController.java deleted file mode 100644 index 87401195..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatController.java +++ /dev/null @@ -1,900 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; - -import java.net.URL; - -import java.text.SimpleDateFormat; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; - -import javax.swing.JList; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.MutableAttributeSet; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyledDocument; - -import org.apache.log4j.Logger; - -import org.jivesoftware.smack.PacketListener; -import org.jivesoftware.smack.SmackConfiguration; -import org.jivesoftware.smack.XMPPException; -import org.jivesoftware.smack.packet.Message; -import org.jivesoftware.smack.packet.Packet; -import org.jivesoftware.smack.packet.PacketExtension; -import org.jivesoftware.smack.packet.Presence; -import org.jivesoftware.smackx.muc.DefaultParticipantStatusListener; -import org.jivesoftware.smackx.muc.DiscussionHistory; -import org.jivesoftware.smackx.muc.MultiUserChat; -import org.jivesoftware.smackx.muc.SubjectUpdatedListener; -import org.jivesoftware.smackx.packet.DelayInformation; -import org.jivesoftware.smackx.packet.MUCUser; - -import de.applejuicenet.client.gui.plugins.jabber.view.MultiUserChatListCellRenderer; -import de.applejuicenet.client.gui.plugins.jabber.view.MultiUserChatPanel; - -public class MultiUserChatController implements SubjectUpdatedListener, ActionListener -{ - private static final Color JOIN_GREEN = new Color(0, 128, 0); - public static final String HTTP_IDENTIFIER = "http://"; - public static final String WWW_IDENTIFIER = "www."; - private final MultiUserChat muc; - private MultiUserChatPanel multiUserChatPanel = null; - private boolean selected = false; - private boolean marked = false; - private Logger logger = Logger.getLogger(MultiUserChatController.class); - private SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss"); - private ArrayList<String> befehle = new ArrayList<String>(); - private int befehlPos = -1; - private JScrollPane userScrollPane = null; - private MultiUserChatUserListModel multiUserChatUserListModel; - private JList userList; - private String nick; - private MyMessageListener myMessageListener; - private MyParticipantListener myParticipantListener; - - public MultiUserChatController(MultiUserChat multiUserChat, String nick) - throws XMPPException - { - this.nick = nick; - muc = multiUserChat; - Calendar cal = Calendar.getInstance(); - - // Historie der letzten 2 Tage holen (wenns der Server zulaesst) - cal.add(Calendar.DATE, -2); - DiscussionHistory history = new DiscussionHistory(); - - history.setSince(cal.getTime()); - myMessageListener = new MyMessageListener(muc); - myParticipantListener = new MyParticipantListener(muc); - muc.addParticipantListener(new PacketListener() - { - public void processPacket(Packet packet) - { - Presence presence = (Presence) packet; - Iterator it = presence.getExtensions(); - - while(it.hasNext()) - { - Object obj = it.next(); - - if(obj instanceof MUCUser) - { - MUCUser user = (MUCUser) obj; - String nick = user.getItem().getJid(); - - if(null != nick && nick.indexOf("@") != -1) - { - String role = user.getItem().getRole(); - String affilation = user.getItem().getAffiliation(); - - nick = nick.substring(0, nick.indexOf("@")); - System.out.println(role); - MultiChatUserMode mode = MultiChatUserMode.getByRole(role); - MutliUserChatUser multiUser = getMultiUserChatUserListModel().getMutliUserChatUserByName(nick); - - if(null == multiUser) - { - multiUser = new MutliUserChatUser(nick); - getMultiUserChatUserListModel().addParticipant(multiUser); - } - - multiUser.setMode(mode); - updateUserList(); - } - } - } - } - }); - muc.addSubjectUpdatedListener(this); - muc.join(nick, null, history, SmackConfiguration.getPacketReplyTimeout()); - getMultiUserChatUserListModel().addParticipant(new MutliUserChatUser(nick)); - updateUserList(); - } - - public String getRoomName() - { - return muc.getRoom(); - } - - public synchronized MultiUserChatPanel getMultiUserChatPanel() - { - if(null == multiUserChatPanel) - { - multiUserChatPanel = new MultiUserChatPanel(); - getMultiUserChatPanel().getTextArea().addKeyListener(new KeyAdapter() - { - public void keyTyped(KeyEvent ke) - { - getMultiUserChatPanel().getTextField().setText(getMultiUserChatPanel().getTextField().getText() + - ke.getKeyChar()); - getMultiUserChatPanel().getTextField().requestFocus(); - } - }); - getMultiUserChatPanel().getTextField().addKeyListener(new KeyAdapter() - { - public void keyReleased(KeyEvent ke) - { - super.keyReleased(ke); - - // if(ke.getKeyCode() == KeyEvent.VK_TAB) - // { - // String text = textField.getText(); - // - // if(text.length() > 0) - // { - // int index = text.lastIndexOf(' '); - // int index2 = text.lastIndexOf(','); - // - // if(index2 > index) - // { - // index = index2; - // } - // - // String searchString; - // - // if(index != -1) - // { - // searchString = text.substring(index + 1).toLowerCase(); - // } - // else - // { - // searchString = text.toLowerCase(); - // } - // - // String treffer = ""; - // int count = 0; - // - // synchronized(usernameList) - // { - // User[] users = usernameList.getValues(); - // String compareValue; - // - // for(int i = 0; i < users.length; i++) - // { - // if(users[i].getName().toLowerCase().startsWith(searchString)) - // { - // treffer += users[i].getName() + " "; - // count++; - // } - // } - // } - // - // if(treffer.length() > 0) - // { - // treffer = treffer.substring(0, treffer.length() - 1); - // if(count == 1) - // { - // if(index != -1) - // { - // String newText = text.subSequence(0, index + 1) + treffer; - // - // textField.setText(newText); - // } - // else - // { - // textField.setText(treffer); - // } - // } - // else if(count > 1) - // { - // updateTextArea("\t" + treffer, false); - // } - // } - // } - // } - if(befehlPos != -1) - { - if(ke.getKeyCode() == KeyEvent.VK_UP) - { - getMultiUserChatPanel().getTextField().setText(befehle.get(befehlPos)); - if(befehlPos > 0) - { - befehlPos--; - } - } - else if(ke.getKeyCode() == KeyEvent.VK_DOWN) - { - if(befehlPos < befehle.size() - 1) - { - befehlPos++; - } - - getMultiUserChatPanel().getTextField().setText(befehle.get(befehlPos)); - } - } - } - }); - getMultiUserChatPanel().getCloseButton().addActionListener(this); - getMultiUserChatPanel().getTextField().addActionListener(this); - } - - return multiUserChatPanel; - } - - public synchronized void updateTextArea(String message, boolean withTimeStamp, Date stamp) - { - Document doc = getMultiUserChatPanel().getTextArea().getDocument(); - int oldCaretPosition = getMultiUserChatPanel().getTextArea().getCaretPosition(); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - - StyleConstants.setBackground(attributes, Color.WHITE); - StyleConstants.setForeground(attributes, Color.BLACK); - int index = message.indexOf('>'); - String compareValue; - boolean eigenerName = false; - boolean doMark = false; - - if(index != -1 && message.length() - 1 > index) - { - compareValue = message.substring(index + 1); - } - else - { - compareValue = message; - } - - boolean isAction = false; - - // if(compareValue.indexOf(parentPanel.getNickname()) != -1) - // { - // StyleConstants.setBackground(attributes, Color.ORANGE); - // eigenerName = true; - // doMark = true; - // } - // if(message.indexOf("---> JOIN:") != -1) - // { - // StyleConstants.setForeground(attributes, JOIN_GREEN); - // } - // else if(message.indexOf("<--- PART:") != -1) - // { - // StyleConstants.setForeground(attributes, Color.RED); - // } - // else if(message.indexOf("<--- QUIT:") != -1) - // { - // StyleConstants.setForeground(attributes, Color.RED); - // } - // else if(message.indexOf('>') == 0) - // { - // StyleConstants.setForeground(attributes, Color.MAGENTA); - // } - // else if(message.startsWith("* ")) - // { - // isAction = true; - // } - // else if(!withTimeStamp || index == -1) - // { - // StyleConstants.setForeground(attributes, Color.GRAY); - // } - if(withTimeStamp) - { - StyleConstants.setForeground(attributes, Color.BLACK); - doMark = true; - } - else - { - StyleConstants.setForeground(attributes, Color.GRAY); - } - - try - { - if(withTimeStamp) - { - String zeit; - - if(null != stamp) - { - zeit = dateFormatter.format(stamp); - } - else - { - zeit = dateFormatter.format(new Date(System.currentTimeMillis())); - } - - doc.insertString(doc.getLength(), "[" + zeit + "]\t", attributes); - } - - if(isAction) - { - Color color = StyleConstants.getForeground(attributes); - - StyleConstants.setForeground(attributes, Color.MAGENTA); - doc.insertString(doc.getLength(), "\t*", attributes); - StyleConstants.setForeground(attributes, color); - message = message.substring(1).trim(); - } - - parseLinks(attributes, doc, message); - } - catch(BadLocationException blE) - { - logger.error("Fehler im JabberPlugin", blE); - } - - if(!selected && doMark) - { - if(eigenerName) - { - - // for(int i = 0; i < tabbedPane.getTabCount(); i++) - // { - // Object tab = tabbedPane.getComponentAt(i); - // - // if(tab == this) - // { - // tabbedPane.setForegroundAt(i, Color.GREEN); - // } - // } - } - - if(!eigenerName && !marked) - { - - // for(int i = 0; i < tabbedPane.getTabCount(); i++) - // { - // Object tab = tabbedPane.getComponentAt(i); - // - // if(tab == this) - // { - // tabbedPane.setForegroundAt(i, Color.RED); - // } - // } - } - - marked = true; - } - - final int newCaretPosition = doc.getLength(); - - if(newCaretPosition != oldCaretPosition) - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - getMultiUserChatPanel().getTextArea().setCaretPosition(newCaretPosition); - } - }); - } - } - - public void updateTextArea(String message) - { - updateTextArea(message, true, null); - } - - private void parseLinks(SimpleAttributeSet attributes, Document doc, String message) - throws BadLocationException - { - while(message.toLowerCase().indexOf(MultiUserChatController.HTTP_IDENTIFIER) != -1 || - message.toLowerCase().indexOf(MultiUserChatController.WWW_IDENTIFIER) != -1) - { - String httpIdentifier; - int indexHttp = message.toLowerCase().indexOf(HTTP_IDENTIFIER); - int indexWww = message.toLowerCase().indexOf(WWW_IDENTIFIER); - - if(indexHttp == -1) - { - httpIdentifier = WWW_IDENTIFIER; - } - else if(indexWww == -1) - { - httpIdentifier = HTTP_IDENTIFIER; - } - else - { - if(indexWww == indexHttp + HTTP_IDENTIFIER.length()) - { - httpIdentifier = HTTP_IDENTIFIER; - } - else - { - httpIdentifier = WWW_IDENTIFIER; - } - } - - doc.insertString(doc.getLength(), message.substring(0, message.toLowerCase().indexOf(httpIdentifier)), attributes); - message = message.substring(message.toLowerCase().indexOf(httpIdentifier)); - int index = message.indexOf(" "); - int index2 = message.indexOf(">"); - - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf(")"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf("]"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - index2 = message.indexOf("}"); - if(index2 != -1 && index2 < index) - { - index = index2; - } - - if(index != -1) - { - doc.insertString(doc.getLength(), message.substring(0, index), setLink(message.substring(0, index), attributes)); - message = message.substring(index); - if(message.indexOf(httpIdentifier, index) == -1) - { - break; - } - } - else - { - doc.insertString(doc.getLength(), message, setLink(message, attributes)); - message = ""; - } - } - - doc.insertString(doc.getLength(), message + "\n", attributes); - } - - private MutableAttributeSet setLink(String sUrl, SimpleAttributeSet attributeSet) - { - MutableAttributeSet a = new SimpleAttributeSet(attributeSet); - - try - { - if(!sUrl.toLowerCase().startsWith(MultiUserChatController.HTTP_IDENTIFIER)) - { - sUrl = MultiUserChatController.HTTP_IDENTIFIER + sUrl; - } - - URL url = new URL(sUrl); - - a.addAttribute(LinkEditorKit.LINK, new URL(sUrl)); - } - catch(Exception e) - { - ; - - // nothing to do - } - - a.addAttribute(StyleConstants.Bold, Boolean.TRUE); - a.addAttribute(StyleConstants.Underline, Boolean.TRUE); - return a; - } - - private synchronized void setTitle(final String title) - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - StyledDocument doc = getMultiUserChatPanel().getTitleArea().getStyledDocument(); - SimpleAttributeSet attributes = new SimpleAttributeSet(); - - StyleConstants.setBackground(attributes, Color.WHITE); - try - { - doc.remove(0, doc.getLength()); - int startIndex = 0; - - for(int i = 0; i < title.length(); i++) - { - if(title.charAt(i) == 3 || i == title.length() - 1) - { - if(title.charAt(i) == 3) - { - String toWrite = title.substring(startIndex, i); - - if(toWrite.length() > 0) - { - attributes = writeString(doc, attributes, toWrite); - } - - startIndex = i + 1; - i++; - } - else - { - String toWrite = title.substring(startIndex); - - if(toWrite.length() > 0) - { - attributes = writeString(doc, attributes, toWrite); - } - } - } - } - } - catch(BadLocationException ex) - { - ex.printStackTrace(); - } - } - }); - } - - private SimpleAttributeSet writeString(StyledDocument doc, SimpleAttributeSet attributes, String toWrite) - { - boolean istNachkomma = false; - boolean parsEnde = false; - int index = 0; - - if(toWrite.length() > 1) - { - while(!parsEnde) - { - try - { - if(toWrite.charAt(index) == ',') - { - istNachkomma = true; - index++; - continue; - } - - int colorCode = Integer.parseInt(toWrite.substring(index, index + 2)); - - index += 2; - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE) - { - if(toWrite.charAt(index + 1) != ',') - { - parsEnde = true; - } - - try - { - int colorCode = Integer.parseInt(toWrite.substring(index, index + 1)); - - index++; - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE2) - { - parsEnde = true; - StyleConstants.setForeground(attributes, Color.BLACK); - } - } - catch(StringIndexOutOfBoundsException sioobE) - { - parsEnde = true; - try - { - int colorCode = Integer.parseInt(toWrite.substring(index, index + 1)); - Color color = getColor(colorCode); - - if(!istNachkomma) - { - StyleConstants.setForeground(attributes, color); - } - } - catch(NumberFormatException nfE2) - { - StyleConstants.setForeground(attributes, Color.BLUE); - } - catch(StringIndexOutOfBoundsException nfE2) - { - StyleConstants.setForeground(attributes, Color.BLACK); - } - - return attributes; - } - } - } - - try - { - doc.insertString(doc.getLength(), toWrite.substring(index), attributes); - } - catch(BadLocationException ex) - { - ex.printStackTrace(); - } - - return attributes; - } - - private Color getColor(int code) - { - switch(code) - { - - case 0: - return Color.BLACK; - - case 1: - return Color.BLACK; - - case 2: - return Color.BLUE; - - case 3: - return Color.GREEN; - - case 4: - return Color.RED; - - case 5: - return Color.BLACK; - - case 6: - return Color.PINK; - - case 7: - return Color.ORANGE; - - case 8: - return Color.YELLOW; - - case 9: - return Color.GREEN; - - case 10: - return Color.GREEN; - - case 11: - return Color.CYAN; - - case 12: - return Color.BLUE; - - case 13: - return Color.PINK; - - case 14: - return Color.GRAY; - - case 15: - return Color.LIGHT_GRAY; - - default: - return Color.BLACK; - } - } - - public void actionPerformed(ActionEvent e) - { - Object source = e.getSource(); - - if(source == getMultiUserChatPanel().getTextField()) - { - final String messageText = getMultiUserChatPanel().getTextField().getText(); - - getMultiUserChatPanel().getTextField().setText(""); - - if(null != messageText && messageText.length() > 0) - { - befehle.add(messageText); - if(befehle.size() > 40) - { - befehle.remove(0); - } - - befehlPos = befehle.size() - 1; - } - - new Thread(new Runnable() - { - public void run() - { - - // Message message = muc.createMessage(); - // message.setBody(messageText); - try - { - muc.sendMessage(messageText); - } - catch(XMPPException e) - { - e.printStackTrace(); - } - } - }).start(); - } - else if(source == getMultiUserChatPanel().getCloseButton()) - { - logger.debug("todo: close room"); - } - } - - public void subjectUpdated(final String subject, String from) - { - setTitle(subject); - } - - public JScrollPane getUserListPane() - { - if(null == userScrollPane) - { - userScrollPane = new JScrollPane(getUserList()); - } - - return userScrollPane; - } - - private MultiUserChatUserListModel getMultiUserChatUserListModel() - { - if(null == multiUserChatUserListModel) - { - multiUserChatUserListModel = new MultiUserChatUserListModel(); - - } - - return multiUserChatUserListModel; - } - - private JList getUserList() - { - if(null == userList) - { - userList = new JList(getMultiUserChatUserListModel()); - userList.setCellRenderer(new MultiUserChatListCellRenderer()); - - } - - return userList; - } - - private void updateUserList() - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - getUserList().updateUI(); - } - }); - } - - private class MyParticipantListener extends DefaultParticipantStatusListener - { - public MyParticipantListener(MultiUserChat muc) - { - muc.addParticipantStatusListener(this); - } - - public void banned(String arg0, String arg1, String arg2) - { - } - - public void joined(String participant) - { - participant = participant.substring(participant.indexOf("/") + 1); - getMultiUserChatUserListModel().addParticipant(new MutliUserChatUser(participant)); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - getUserList().updateUI(); - } - }); - } - - public void kicked(String participant, String arg1, String arg2) - { - removeParticipant(participant); - } - - private void removeParticipant(String participant) - { - participant = participant.substring(participant.indexOf("/") + 1); - MutliUserChatUser user = getMultiUserChatUserListModel().getMutliUserChatUserByName(participant); - - if(null == user) - { - return; - } - - getMultiUserChatUserListModel().removeParticipant(user); - updateUserList(); - } - - public void left(String participant) - { - removeParticipant(participant); - } - - public void nicknameChanged(String arg0, String arg1) - { - } - } - - - private class MyMessageListener implements PacketListener - { - public MyMessageListener(MultiUserChat muc) - { - muc.addMessageListener(this); - } - - public void processPacket(Packet packet) - { - final Message message = (Message) packet; - - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - String from = message.getFrom(); - int index = message.getFrom().indexOf("/"); - - if(index != -1) - { - from = from.substring(index + 1); - Iterator it = message.getExtensions(); - Date stamp = null; - - while(it.hasNext()) - { - PacketExtension ext = (PacketExtension) it.next(); - - if(ext instanceof DelayInformation) - { - stamp = ((DelayInformation) ext).getStamp(); - break; - } - } - - updateTextArea(from + ": " + message.getBody(), true, stamp); - } - else - { - updateTextArea(message.getBody(), false, null); - } - } - }); - } - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatUserListModel.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatUserListModel.java deleted file mode 100644 index 6c7d5b93..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MultiUserChatUserListModel.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control; - -import java.util.ArrayList; -import java.util.List; - -import javax.swing.AbstractListModel; - -public class MultiUserChatUserListModel extends AbstractListModel -{ - private List<MutliUserChatUser> users = new ArrayList<MutliUserChatUser>(); - - public Object getElementAt(int index) - { - return users.get(index); - } - - public int getSize() - { - return users.size(); - } - - public void addParticipant(MutliUserChatUser participant) - { - users.add(participant); - } - - public MutliUserChatUser getMutliUserChatUserByName(String name) - { - for(MutliUserChatUser curMutliUserChatUser : users) - { - if(curMutliUserChatUser.getName().equals(name)) - { - return curMutliUserChatUser; - } - } - - return null; - } - - public void removeParticipant(MutliUserChatUser participant) - { - users.remove(participant); - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MutliUserChatUser.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MutliUserChatUser.java deleted file mode 100644 index dd6f0bcc..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/MutliUserChatUser.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control; - -public class MutliUserChatUser -{ - private String name; - private MultiChatUserMode mode = MultiChatUserMode.NOTHING; - - public MutliUserChatUser(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - @Override - public boolean equals(Object obj) - { - return name.equals(obj.toString()); - } - - @Override - public String toString() - { - return name; - } - - public void setMode(MultiChatUserMode mode) - { - this.mode = mode; - } - - public MultiChatUserMode getHighestMode() - { - return mode; - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/rostertree/RosterTreeNode.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/rostertree/RosterTreeNode.java deleted file mode 100644 index 3c1f81d1..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/control/rostertree/RosterTreeNode.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.control.rostertree; - -import java.util.Comparator; -import java.util.Enumeration; -import java.util.Set; -import java.util.TreeSet; - -import javax.swing.tree.MutableTreeNode; -import javax.swing.tree.TreeNode; - -import org.jivesoftware.smack.packet.Presence; - -public class RosterTreeNode implements MutableTreeNode -{ - private Set<RosterTreeNode> users = new TreeSet<RosterTreeNode>(new Comparator<RosterTreeNode>() - { - public int compare(RosterTreeNode o1, RosterTreeNode o2) - { - return o1.getText().compareToIgnoreCase(o2.getText()); - } - }); - private RosterTreeNode parent = null; - private String text = ""; - private Presence presence = null; - - public RosterTreeNode(String text) - { - this.text = text; - } - - public RosterTreeNode() - { - this(""); - } - - public void removeAllChildren() - { - for(int i = users.size() - 1; i >= 0; i--) - { - remove(i); - } - } - - public void insert(MutableTreeNode child, int index) - { - users.add((RosterTreeNode) child); - child.setParent(this); - } - - public void remove(int index) - { - remove(users.toArray(new RosterTreeNode[users.size()])[index]); - } - - public void remove(MutableTreeNode node) - { - users.remove(node); - node.setParent(null); - } - - public void removeFromParent() - { - if(null != parent) - { - parent.remove(this); - parent = null; - } - } - - public void setParent(MutableTreeNode newParent) - { - parent = (RosterTreeNode) newParent; - } - - public void setUserObject(Object object) - { - - // ?? - } - - public Enumeration children() - { - return new Enumeration() - { - private int index = 0; - - public boolean hasMoreElements() - { - return users.size() > index; - } - - public Object nextElement() - { - index++; - return users.toArray(new RosterTreeNode[users.size()])[index]; - } - }; - } - - public boolean getAllowsChildren() - { - return true; - } - - public TreeNode getChildAt(int childIndex) - { - return users.toArray(new RosterTreeNode[users.size()])[childIndex]; - } - - public int getChildCount() - { - return users.size(); - } - - public int getIndex(TreeNode node) - { - RosterTreeNode[] allNodes = users.toArray(new RosterTreeNode[users.size()]); - - for(int i = 0; i < allNodes.length; i++) - { - if(allNodes[i] == node) - { - return i; - } - } - - return -1; - } - - public TreeNode getParent() - { - return parent; - } - - public boolean isLeaf() - { - return users.size() == 0; - } - - @Override - public String toString() - { - return getText(); - } - - public String getText() - { - return text; - } - - public void setText(String text) - { - this.text = text; - } - - public Presence getPresence() - { - return presence; - } - - public void setPresence(Presence presence) - { - this.presence = presence; - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/IdentityPanel.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/IdentityPanel.java deleted file mode 100644 index 47195ae7..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/IdentityPanel.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.applejuicenet.client.gui.plugins.jabber.view; - -import java.awt.Dimension; - -import javax.swing.BorderFactory; -import javax.swing.JScrollPane; -import javax.swing.JTree; - -public class IdentityPanel extends JScrollPane -{ - private JTree knownUsersTree = null; - - public IdentityPanel() - { - setViewportView(getKnownUsersTree()); - setBorder(BorderFactory.createTitledBorder("Kontakte")); - setMinimumSize(new Dimension(140, 10)); - } - - public JTree getKnownUsersTree() - { - if(null == knownUsersTree) - { - knownUsersTree = new JTree(); - knownUsersTree.setRootVisible(false); - } - - return knownUsersTree; - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatListCellRenderer.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatListCellRenderer.java deleted file mode 100644 index bf3ecd8a..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatListCellRenderer.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.view; - -import java.awt.Component; - -import javax.swing.DefaultListCellRenderer; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JList; - -import de.applejuicenet.client.gui.plugins.jabber.control.MultiChatUserMode; -import de.applejuicenet.client.gui.plugins.jabber.control.MutliUserChatUser; - -public class MultiUserChatListCellRenderer extends DefaultListCellRenderer -{ - public static ImageIcon owner; - public static ImageIcon moderator; - public static ImageIcon member; - public static ImageIcon voice; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) - { - MultiChatUserMode mode = ((MutliUserChatUser) value).getHighestMode(); - JLabel comp = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if(mode == MultiChatUserMode.MODERATOR) - { - comp.setIcon(moderator); - } - else if(mode == MultiChatUserMode.OWNER) - { - comp.setIcon(owner); - } - else if(mode == MultiChatUserMode.MEMBER) - { - comp.setIcon(member); - } - else if(mode == MultiChatUserMode.VOICE) - { - comp.setIcon(voice); - } - else if(mode == MultiChatUserMode.NOTHING) - { - comp.setIcon(null); - } - - return comp; - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatPanel.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatPanel.java deleted file mode 100644 index af8d5aaa..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/MultiUserChatPanel.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.view; - -import java.awt.AWTKeyStroke; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.KeyboardFocusManager; -import java.awt.event.KeyEvent; - -import java.util.HashSet; -import java.util.Set; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.text.StyledDocument; - -import org.apache.log4j.Logger; - -import de.applejuicenet.client.gui.plugins.jabber.control.LinkEditorKit; -import de.applejuicenet.client.gui.start.HyperlinkAdapter; - -import de.tklsoft.gui.controls.TKLPanel; - -public class MultiUserChatPanel extends TKLPanel -{ - private JTextPane textArea = new JTextPane(); - private StyledDocument document = (StyledDocument) textArea.getStyledDocument(); - private JTextField textField; - private JTextPane titleArea = new JTextPane(); - private JButton closeButton = new JButton("X"); - private Logger logger = Logger.getLogger(MultiUserChatPanel.class); - - public MultiUserChatPanel() - { - initGUI(); - } - - private void initGUI() - { - setLayout(new BorderLayout()); - textArea.setEditorKit(new LinkEditorKit()); - textArea.setDocument(document); - textArea.setEditable(false); - textArea.addHyperlinkListener(new HyperlinkAdapter(textArea)); - textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - textArea.setBackground(Color.WHITE); - textField = new JTextField(); - Set<AWTKeyStroke> set = new HashSet<AWTKeyStroke>(1); - - set.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_JAPANESE_HIRAGANA, 0)); - textField.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set); - - JScrollPane sp1 = new JScrollPane(textArea); - JPanel panel1 = new JPanel(new BorderLayout()); - - sp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - add(sp1, BorderLayout.CENTER); - add(textField, BorderLayout.SOUTH); - add(makeNorth(), BorderLayout.NORTH); - } - - private Box makeNorth() - { - Box northBox = Box.createHorizontalBox(); - - northBox.add(closeButton); - titleArea.setEditable(false); - northBox.add(titleArea); - - return northBox; - } - - public JTextPane getTextArea() - { - return textArea; - } - - public JTextField getTextField() - { - return textField; - } - - public JTextPane getTitleArea() - { - return titleArea; - } - - public JButton getCloseButton() - { - return closeButton; - } -} diff --git a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/RosterUserTreeCellRenderer.java b/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/RosterUserTreeCellRenderer.java deleted file mode 100644 index dd7b8e89..00000000 --- a/AJClientGUI/plugin_src/jabber/src/de/applejuicenet/client/gui/plugins/jabber/view/RosterUserTreeCellRenderer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.jabber.view; - -import java.awt.Component; - -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JTree; -import javax.swing.tree.DefaultTreeCellRenderer; - -import org.jivesoftware.smack.packet.Presence; - -import de.applejuicenet.client.gui.plugins.jabber.control.rostertree.RosterTreeNode; - -public class RosterUserTreeCellRenderer extends DefaultTreeCellRenderer -{ - public static ImageIcon available; - public static ImageIcon offline; - public static ImageIcon awk; - - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, - int row, boolean hasFocus) - { - Component comp = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); - RosterTreeNode node = (RosterTreeNode) value; - - if(null == node.getParent()) - { - - // rootnode - return comp; - } - - if(leaf) - { - ImageIcon icon; - - Presence presence = node.getPresence(); - String toolTipText; - - if(null == presence) - { - icon = offline; - toolTipText = "offline"; - } - else if(presence.getMode() == Presence.Mode.AVAILABLE) - { - icon = available; - toolTipText = presence.getMode().toString(); - } - else - { - icon = awk; - toolTipText = presence.getMode().toString(); - } - - ((JLabel) comp).setIcon(icon); - ((JLabel) comp).setToolTipText(toolTipText); - return comp; - } - - return comp; - } -} diff --git a/AJClientGUI/plugin_src/serverwatcher/serverwatcher.xml b/AJClientGUI/plugin_src/serverwatcher/serverwatcher.xml deleted file mode 100644 index c3d20beb..00000000 --- a/AJClientGUI/plugin_src/serverwatcher/serverwatcher.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<root> - <server> - </server> -</root> diff --git a/AJClientGUI/plugin_src/speedgraph/icons/icon.gif b/AJClientGUI/plugin_src/speedgraph/icons/icon.gif deleted file mode 100644 index 60cf1f3b..00000000 Binary files a/AJClientGUI/plugin_src/speedgraph/icons/icon.gif and /dev/null differ diff --git a/AJClientGUI/plugin_src/speedgraph/plugin.properties b/AJClientGUI/plugin_src/speedgraph/plugin.properties deleted file mode 100644 index 27fcd3ab..00000000 --- a/AJClientGUI/plugin_src/speedgraph/plugin.properties +++ /dev/null @@ -1,7 +0,0 @@ -general.title=SpeedGraph -general.version=1.4 -general.author=Maj0r -general.contact=tkrall@tkl-soft.de -general.description=Der SpeedGraph zeigt die Historie der Download- und Uploadgeschwindigkeit an. Bentigt wird ein GUI ab 0.70.2 -general.istab=true -general.classname=de.applejuicenet.client.gui.plugins.speedgraph.SpeedGraphPlugin \ No newline at end of file diff --git a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/GraphPanel.java b/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/GraphPanel.java deleted file mode 100644 index 4b45e095..00000000 --- a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/GraphPanel.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.speedgraph; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.image.BufferedImage; - -import java.text.SimpleDateFormat; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.JPanel; -import javax.swing.SwingUtilities; - -import de.applejuicenet.client.AppleJuiceClient; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/GraphPanel.java,v 1.8 2009/01/12 11:59:59 maj0r Exp $ - * - * <p>Titel: AppleJuice Core-GUI</p> - * <p>Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> - * <p>Copyright: General Public License</p> - * - * @author: Maj0r <aj@tkl-soft.de> - * - */ -public class GraphPanel extends JPanel -{ - private String uploadSpeedKey = "uploadspeed"; - private String downloadSpeedKey = "downloadspeed"; - private int leftBorder = 33; - private int width; - private int imageHeight; - private int bottomHeight = 30; - private int topHeight = 30; - private int minImageHeight = bottomHeight + 280; - private long time; - private SimpleDateFormat formatter = new SimpleDateFormat("HH:mm"); - private Font timeFont; - private Image image = null; - private UpdateThread updateThread; - private Map<Integer, Integer> pendingDownloadSpeeds = new HashMap<Integer, Integer>(); - private Map<Integer, Integer> pendingUploadSpeeds = new HashMap<Integer, Integer>(); - private double pxPerKb; - private int lastUploadY; - private int lastDownloadY; - private Integer curX = 0; - - public GraphPanel() - { - updateThread = new UpdateThread(); - updateThread.start(); - } - - @Override - protected void paintComponent(Graphics g) - { - if(null != image) - { - Dimension size = getSize(); - - // wird ggf. skaliert - g.drawImage(image, 0, 0, size.width, size.height, null); - } - else - { - super.paintComponent(g); - } - } - - @SuppressWarnings("unchecked") - public synchronized void update(HashMap speeds) - { - curX++; - synchronized(pendingDownloadSpeeds) - { - pendingDownloadSpeeds.put(curX, ((Long) speeds.get(downloadSpeedKey)).intValue()); - } - - synchronized(pendingDownloadSpeeds) - { - pendingUploadSpeeds.put(curX, ((Long) speeds.get(uploadSpeedKey)).intValue()); - } - } - - private class UpdateThread extends Thread - { - public UpdateThread() - { - super("SpeedGraphPaintThread"); - setDaemon(true); - } - - @Override - public void run() - { - while(true) - { - try - { - sleep(2000); - } - catch(InterruptedException e) - { - - // nix zu tun - ; - } - - if(null == image) - { - width = getWidth(); - if(getHeight() < minImageHeight) - { - imageHeight = minImageHeight; - } - else - { - imageHeight = getHeight(); - } - - if(width == 0 || imageHeight == 0) - { - - /* - Da kamen schneller Daten rein, als das Plugin angezeigt werden konnte. - Wir nehmen folglich erst den naechsten Durchgang. - */ - continue; - } - - long maxDownKb = AppleJuiceClient.getAjFassade().getCurrentAJSettings().getMaxDownloadInKB(); - - int remainingHeight = imageHeight - bottomHeight - topHeight; - - pxPerKb = ((double) remainingHeight) / (maxDownKb + 10); - - int yAbstaende = 30; - int anzahlMarks = (remainingHeight / yAbstaende); - - image = new BufferedImage(width, imageHeight, BufferedImage.TYPE_INT_ARGB); - Graphics g = image.getGraphics(); - - // erstmal schwaerzen - g.setColor(Color.BLACK); - g.fillRect(0, 0, width, imageHeight); - - g.setColor(Color.WHITE); - // senkrechte Linie - g.drawLine(leftBorder, imageHeight - bottomHeight, leftBorder, topHeight); - FontMetrics fm = g.getFontMetrics(); - String markText; - int strWidth; - int strHeight = fm.getHeight(); - - for(int i = 0; i <= anzahlMarks; i++) - { - markText = "" + (int) (((double) (maxDownKb + 10)) / anzahlMarks * i); - strWidth = fm.stringWidth(markText); - - g.drawString(markText, leftBorder - strWidth - 4, imageHeight - bottomHeight - i * yAbstaende); - g.drawLine(leftBorder - 2, imageHeight - bottomHeight - i * yAbstaende, width, - imageHeight - bottomHeight - i * yAbstaende); - } - - strWidth = fm.stringWidth("kb/s"); - g.drawString("kb/s", leftBorder - (strWidth / 2), topHeight / 2); - g.setColor(Color.GREEN); - g.drawLine(70, topHeight / 2, 85, topHeight / 2); - g.setColor(Color.WHITE); - g.drawString("Download", 92, topHeight / 4 * 3); - - g.setColor(Color.YELLOW); - g.drawLine(170, topHeight / 2, 185, topHeight / 2); - g.setColor(Color.WHITE); - g.drawString("Upload", 192, topHeight / 4 * 3); - - Font gFont = g.getFont(); - - timeFont = new Font(gFont.getName(), gFont.getStyle(), 9); - g.setFont(timeFont); - fm = g.getFontMetrics(); - time = System.currentTimeMillis(); - String actualTime = formatter.format(new Date(time)); - - strWidth = fm.stringWidth(actualTime); - g.drawString(actualTime, leftBorder - strWidth / 2, imageHeight - (bottomHeight / 2)); - } - - Map<Integer, Integer> copyPendingDownloadSpeeds = new HashMap<Integer, Integer>(); - Map<Integer, Integer> copyPendingUploadSpeeds = new HashMap<Integer, Integer>(); - - synchronized(pendingDownloadSpeeds) - { - copyPendingDownloadSpeeds.putAll(pendingDownloadSpeeds); - pendingDownloadSpeeds.clear(); - } - - synchronized(pendingDownloadSpeeds) - { - copyPendingUploadSpeeds.putAll(pendingUploadSpeeds); - pendingUploadSpeeds.clear(); - } - - Graphics g = image.getGraphics(); - - g.setColor(Color.GREEN); - Integer speed; - - int curLastX = -1; - - for(Integer actualX : copyPendingDownloadSpeeds.keySet()) - { - speed = copyPendingDownloadSpeeds.get(actualX); - int curY = (int) (speed * pxPerKb); - - if(actualX > 0) - { - g.drawLine(leftBorder + actualX - 1, imageHeight - bottomHeight - lastDownloadY, leftBorder + actualX, - imageHeight - bottomHeight - curY); - } - - lastDownloadY = curY; - curLastX = actualX; - } - - g.setColor(Color.YELLOW); - for(Integer actualX : copyPendingUploadSpeeds.keySet()) - { - speed = copyPendingUploadSpeeds.get(actualX); - int curY = (int) (speed * pxPerKb); - - if(actualX > 0) - { - g.drawLine(leftBorder + actualX - 1, imageHeight - bottomHeight - lastUploadY, leftBorder + actualX, - imageHeight - bottomHeight - curY); - } - - lastUploadY = curY; - curLastX = actualX; - } - - long curTime = System.currentTimeMillis(); - - if(curLastX != -1 && time - curTime > 300000) - { - g.setColor(Color.WHITE); - Font gFont = g.getFont(); - - timeFont = new Font(gFont.getName(), gFont.getStyle(), 9); - g.setFont(timeFont); - FontMetrics fm = g.getFontMetrics(); - - fm = g.getFontMetrics(); - String actualTime = formatter.format(new Date(curTime)); - - int strWidth = fm.stringWidth(actualTime); - - g.drawString(actualTime, leftBorder + curLastX - strWidth / 2, imageHeight - (bottomHeight / 2)); - time = curTime; - } - - if(SpeedGraphPlugin.doPaint) - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - repaint(); - } - }); - } - } - } - } -} diff --git a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPlugin.java b/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPlugin.java deleted file mode 100644 index 626b8116..00000000 --- a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPlugin.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.speedgraph; - -import java.awt.BorderLayout; -import java.awt.Color; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import javax.swing.ImageIcon; -import javax.swing.JScrollPane; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.AppleJuiceClient; -import de.applejuicenet.client.gui.plugins.PluginConnector; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPlugin.java,v 1.4 2009/01/12 11:59:59 maj0r Exp $ - * - * <p>Titel: AppleJuice Core-GUI</p> - * <p>Beschreibung: Erstes GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> - * <p>Copyright: General Public License</p> - * - * @author: Maj0r <aj@tkl-soft.de> - * - */ -public class SpeedGraphPlugin extends PluginConnector -{ - private static Logger logger; - private GraphPanel graphPanel = new GraphPanel(); - public static boolean doPaint = false; - - public SpeedGraphPlugin(Properties properties, Map<String, Properties> languageFiles, ImageIcon icon, - Map<String, ImageIcon> availableIcons) - { - super(properties, languageFiles, icon, availableIcons); - logger = Logger.getLogger(getClass()); - try - { - setLayout(new BorderLayout()); - graphPanel.setBackground(Color.BLACK); - add(new JScrollPane(graphPanel), BorderLayout.CENTER); - setBackground(Color.BLACK); - AppleJuiceClient.getAjFassade().addDataUpdateListener(this, DATALISTENER_TYPE.SPEED_CHANGED); - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error("Unbehandelte Exception", e); - } - } - } - - public void fireLanguageChanged() - { - } - - /*Wird automatisch aufgerufen, wenn neue Informationen vom Server eingegangen sind. - ber den DataManger knnen diese abgerufen werden.*/ - @SuppressWarnings("unchecked") - public void fireContentChanged(DATALISTENER_TYPE type, Object content) - { - if(type == DATALISTENER_TYPE.SPEED_CHANGED) - { - graphPanel.update((HashMap) content); - } - } - - public void registerSelected() - { - doPaint = true; - } - - @Override - public void lostSelection() - { - doPaint = false; - } -} diff --git a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPluginTestLoader.java b/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPluginTestLoader.java deleted file mode 100644 index 29e1c230..00000000 --- a/AJClientGUI/plugin_src/speedgraph/src/de/applejuicenet/client/gui/plugins/speedgraph/SpeedGraphPluginTestLoader.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.plugins.speedgraph; - -import java.util.Map; -import java.util.Properties; - -import javax.swing.ImageIcon; - -import de.applejuicenet.client.gui.plugincontrol.TestLoader; -import de.applejuicenet.client.gui.plugins.PluginConnector; - -public class SpeedGraphPluginTestLoader extends TestLoader -{ - public SpeedGraphPluginTestLoader() - { - super(); - } - - @Override - protected String getPath() - { - return "speedgraph"; - } - - @Override - protected PluginConnector getPlugin(Properties properties, Map<String, Properties> languageFiles, - ImageIcon icon, Map<String, ImageIcon> availableIcons) - { - return new SpeedGraphPlugin(properties, languageFiles, icon, availableIcons); - } -} diff --git a/AJClientGUI/plugin_src/versionchecker/icons/icon.gif b/AJClientGUI/plugin_src/versionchecker/icons/icon.gif deleted file mode 100644 index ffbb8254..00000000 Binary files a/AJClientGUI/plugin_src/versionchecker/icons/icon.gif and /dev/null differ diff --git a/AJClientGUI/plugins/ircplugin.jar b/AJClientGUI/plugins/ircplugin.jar deleted file mode 100644 index c29318af..00000000 Binary files a/AJClientGUI/plugins/ircplugin.jar and /dev/null differ diff --git a/AJClientGUI/plugins/logviewerplugin.jar b/AJClientGUI/plugins/logviewerplugin.jar deleted file mode 100644 index 9a77dd0b..00000000 Binary files a/AJClientGUI/plugins/logviewerplugin.jar and /dev/null differ diff --git a/AJClientGUI/plugins/readme.txt b/AJClientGUI/plugins/readme.txt deleted file mode 100644 index 7c10be6b..00000000 --- a/AJClientGUI/plugins/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -In dieses Verzeichnis kommen die Plugins als jar-Archive rein. -Falls Du Linux verwendest, wird dieses Verzeichnis nicht beachtet. Dann gehren Plugins ins Verzeichnis ~/appleJuice/gui/plugins . \ No newline at end of file diff --git a/AJClientGUI/plugins/serverwatcher.jar b/AJClientGUI/plugins/serverwatcher.jar deleted file mode 100644 index a8b6655e..00000000 Binary files a/AJClientGUI/plugins/serverwatcher.jar and /dev/null differ diff --git a/AJClientGUI/plugins/versioncheckerplugin.jar b/AJClientGUI/plugins/versioncheckerplugin.jar deleted file mode 100644 index 5d7f033d..00000000 Binary files a/AJClientGUI/plugins/versioncheckerplugin.jar and /dev/null differ diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/ApplejuiceFassadeDummy.java b/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/ApplejuiceFassadeDummy.java deleted file mode 100644 index d238cd1c..00000000 --- a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/ApplejuiceFassadeDummy.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Created on 14.02.2005 - */ -package test.de.applejuicenet.client.gui.powerdownload; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import junit.framework.Assert; -import de.applejuicenet.client.fassade.ApplejuiceFassade; -import de.applejuicenet.client.fassade.controller.CoreConnectionSettingsHolder; -import de.applejuicenet.client.fassade.entity.Download; -import de.applejuicenet.client.fassade.exception.IllegalArgumentException; - -/** - * @author loevenit - */ -public class ApplejuiceFassadeDummy extends ApplejuiceFassade -{ - private Map<String, Download> snapshot = null; - private List<DownloadDummy> expected = new Vector<DownloadDummy>(); - - public ApplejuiceFassadeDummy(Map<String, Download> downloads) throws IllegalArgumentException - { - super(new CoreConnectionSettingsHolder("localhost", new Integer(80), "", true)); - snapshot = downloads; - } - - public ApplejuiceFassadeDummy() throws IllegalArgumentException - { - super(new CoreConnectionSettingsHolder("localhost", new Integer(80), "", true)); - snapshot = new HashMap<String,Download>(); - } - - public Map<String, Download> getDownloadsSnapshot() - { - return snapshot; - } - - public void pauseDownload(List<Download> downloads) - throws IllegalArgumentException - { - for (Download cur : downloads) { - ((DownloadDummy)cur).setStatus(Download.PAUSIERT); - snapshot.put(Integer.toString(cur.getId()), cur); - } - } - - public void resumeDownload(List<Download> downloads) - throws IllegalArgumentException - { - for (Download cur : downloads) { - ((DownloadDummy)cur).setStatus(Download.SUCHEN_LADEN); - snapshot.put(Integer.toString(cur.getId()), cur); - } - } - public void setPowerDownload(List<Download> downloads, Integer powerDownload) - throws IllegalArgumentException - { - for (Download cur : downloads) { - ((DownloadDummy)cur).setPowerdownload(powerDownload); - snapshot.put(Integer.toString(cur.getId()), cur); - } - } - - public void addDownload(Download download) - { - this.snapshot.put(Integer.toString(download.getId()), download); - } - - public void addExpectedDownload(DownloadDummy dummy) - { - this.expected.add(dummy); - } - - public void clearExpectedDownload() - { - this.expected.clear(); - } - - public void verify() { - Assert.assertEquals("expected.size() != snapshot.size()", expected.size(), snapshot.size()); - for (DownloadDummy cur : expected) { - Download download = snapshot.get(Integer.toString(cur.getId())); - Assert.assertNotNull(download); - Assert.assertEquals("Filename nicht gleich", cur.getFilename(), download.getFilename()); - Assert.assertEquals("Status nicht gleich", cur.getStatus(), download.getStatus()); - Assert.assertEquals("BereitsGeladen nicht gleich", cur.getProzentGeladen(), download.getProzentGeladen(), 0.00); - Assert.assertEquals("Powerdownload nicht gleich", cur.getPowerDownload(), download.getPowerDownload()); - Assert.assertEquals("Groesse nicht gleich", cur.getGroesse(), download.getGroesse()); - Assert.assertEquals("quellen nicht gleich", cur.getSources(), download.getSources()); - } - } -} diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadDummy.java b/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadDummy.java deleted file mode 100644 index 363a1606..00000000 --- a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadDummy.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Created on 14.02.2005 - */ -package test.de.applejuicenet.client.gui.powerdownload; - -import de.applejuicenet.client.fassade.entity.Download; -import de.applejuicenet.client.fassade.entity.DownloadSource; - -/** - * @author loevenit - */ -public class DownloadDummy implements Download -{ - private Integer id; - private String bezeichnung; - private double prozentGeladen; - private int status; - private int powerdwl; - private long groesse; - private DownloadSource[] quellen; - - public DownloadDummy(Integer id, String bezeichnung, double prozentGeladen, int status, int powerdwl, long groesse, DownloadSource[] quellen) - { - super(); - this.id = id; - this.bezeichnung = bezeichnung; - this.prozentGeladen = prozentGeladen; - this.status = status; - this.powerdwl = powerdwl; - this.groesse = groesse; - this.quellen = quellen; - } - - public DownloadDummy(Integer id, String bezeichnung, double prozentGeladen, int status, int powerdwl) - { - this(id, bezeichnung, prozentGeladen, status, powerdwl, 0, null); - } - - public DownloadDummy(int id, String bezeichnung, double prozentGeladen, int status, int powerdwl) - { - this(new Integer(id), bezeichnung, prozentGeladen, status, powerdwl); - } - - public DownloadDummy(int id, double prozentGeladen, int status, int powerdwl, int groesse, DownloadSource[] quellen) - { - this(new Integer(id), "", prozentGeladen, status, powerdwl, groesse, quellen); - } - - public DownloadDummy(int id, double prozentGeladen, int status, int powerdwl, int groesse) - { - this(new Integer(id), "", prozentGeladen, status, powerdwl, groesse, null); - } - - public DownloadDummy(int id, double prozentGeladen, int status, int powerdwl) - { - this(id, prozentGeladen, status, powerdwl, 0); - } - - public DownloadDummy(int id, int status, int powerdwl, int groesse) - { - this(id, 1.0, status, powerdwl, groesse); - } - - public String getProzentGeladenAsString() - { - return Double.toString(prozentGeladen); - } - - public double getProzentGeladen() - { - return prozentGeladen; - } - - public DownloadSource getSourceById(int sourceId) - { - // TODO Auto-generated method stub - return null; - } - - public DownloadSource[] getSources() - { - return quellen; - } - - public int getShareId() - { - // TODO Auto-generated method stub - return 0; - } - - public String getHash() - { - // TODO Auto-generated method stub - return null; - } - - public long getGroesse() - { - return groesse; - } - - public int getStatus() - { - return status; - } - - public String getFilename() - { - return bezeichnung; - } - - public String getTargetDirectory() - { - // TODO Auto-generated method stub - return null; - } - - public int getPowerDownload() - { - return powerdwl; - } - - public int getId() - { - return id.intValue(); - } - - public int getTemporaryFileNumber() - { - // TODO Auto-generated method stub - return 0; - } - - public long getReady() - { - // TODO Auto-generated method stub - return 0; - } - - public long getRestZeit() - { - // TODO Auto-generated method stub - return 0; - } - - public String getRestZeitAsString() - { - // TODO Auto-generated method stub - return null; - } - - public long getSpeedInBytes() - { - // TODO Auto-generated method stub - return 0; - } - - public long getBereitsGeladen() - { - return 0; - } - - public void setStatus(int status) - { - this.status = status; - } - - public void setPowerdownload(Integer powerDownload) - { - this.powerdwl = powerDownload.intValue(); - } -} \ No newline at end of file diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadSourceDummy.java b/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadSourceDummy.java deleted file mode 100644 index 9c5c5563..00000000 --- a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/DownloadSourceDummy.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Created on 17.02.2005 - */ -package test.de.applejuicenet.client.gui.powerdownload; - -import de.applejuicenet.client.fassade.entity.DownloadSource; -import de.applejuicenet.client.fassade.entity.Version; - -/** - * @author loevenit - */ -public class DownloadSourceDummy extends DownloadSource -{ - - public int getStatus() - { - // TODO Auto-generated method stub - return 0; - } - - public int getSize() - { - // TODO Auto-generated method stub - return 0; - } - - public int getHerkunft() - { - // TODO Auto-generated method stub - return 0; - } - - public int getDirectstate() - { - // TODO Auto-generated method stub - return 0; - } - - public int getDownloadFrom() - { - // TODO Auto-generated method stub - return 0; - } - - public int getDownloadTo() - { - // TODO Auto-generated method stub - return 0; - } - - public int getActualDownloadPosition() - { - // TODO Auto-generated method stub - return 0; - } - - public int getSpeed() - { - // TODO Auto-generated method stub - return 0; - } - - public Version getVersion() - { - // TODO Auto-generated method stub - return null; - } - - public int getQueuePosition() - { - // TODO Auto-generated method stub - return 0; - } - - public int getPowerDownload() - { - // TODO Auto-generated method stub - return 0; - } - - public String getFilename() - { - // TODO Auto-generated method stub - return null; - } - - public String getNickname() - { - // TODO Auto-generated method stub - return null; - } - - public int getId() - { - // TODO Auto-generated method stub - return 0; - } - - public int getDownloadId() - { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/TestStandardAutomaticPwdlPolicy.java b/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/TestStandardAutomaticPwdlPolicy.java deleted file mode 100644 index f845e1e1..00000000 --- a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/test/de/applejuicenet/client/gui/powerdownload/TestStandardAutomaticPwdlPolicy.java +++ /dev/null @@ -1,288 +0,0 @@ - -package test.de.applejuicenet.client.gui.powerdownload; - -import java.util.HashMap; -import java.util.Map; - -import junit.framework.TestCase; -import de.applejuicenet.client.fassade.entity.Download; -import de.applejuicenet.client.fassade.entity.DownloadSource; -import de.applejuicenet.client.fassade.exception.IllegalArgumentException; -import de.applejuicenet.client.gui.powerdownload.StandardAutomaticPwdlPolicy; -import de.applejuicenet.client.gui.powerdownload.StandardAutomaticPwdlPolicy.Reihenfolge; - -public class TestStandardAutomaticPwdlPolicy extends TestCase -{ - private ApplejuiceFassadeDummy fassade = null; - private StandardAutomaticPwdlPolicy policy = null; - private DownloadSourceDummy DUMMY = new DownloadSourceDummy(); - private DownloadSource[] EINE_QUELLE = new DownloadSource[]{DUMMY}; - private DownloadSource[] ZWEI_QUELLEN = new DownloadSource[]{DUMMY,DUMMY}; - private DownloadSource[] DREI_QUELLEN = new DownloadSource[]{DUMMY,DUMMY,DUMMY}; - private DownloadSource[] VIER_QUELLEN = new DownloadSource[]{DUMMY,DUMMY,DUMMY,DUMMY}; - private static Reihenfolge[] SOURCEN_PROZENT_GROESSE = - new Reihenfolge[]{ - Reihenfolge.SOURCEN, - Reihenfolge.PROZENT_GELADEN, - Reihenfolge.GROESSE, - Reihenfolge.ID - }; - private static Reihenfolge[] PROZENT_SOURCEN_GROESSE = - new Reihenfolge[]{ - Reihenfolge.PROZENT_GELADEN, - Reihenfolge.SOURCEN, - Reihenfolge.GROESSE, - Reihenfolge.ID - }; - private static Reihenfolge[] GROESSE_PROZENT_SOURCEN = - new Reihenfolge[]{ - Reihenfolge.GROESSE, - Reihenfolge.PROZENT_GELADEN, - Reihenfolge.SOURCEN, - Reihenfolge.ID - }; - - protected void setUp() throws Exception - { - super.setUp(); - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - } - - protected void tearDown() throws Exception - { - super.tearDown(); - fassade = null; - policy = null; - } - - public void testDoSimpleAction() throws IllegalArgumentException - { - try - { - policy.doAction(); - } - catch (Exception e) - { - fail("Fehler: " + e.getMessage()); - e.printStackTrace(); - } - fassade.verify(); - } - - public void testDoOneAction() throws IllegalArgumentException - { - Map<String,Download> downloads = new HashMap<String,Download>(); - downloads.put(Integer.toString(1), new DownloadDummy(new Integer(1), "bla1", 1.1, Download.SUCHEN_LADEN, 1)); - fassade = new ApplejuiceFassadeDummy(downloads); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addExpectedDownload(new DownloadDummy(new Integer(1), "bla1", 1.1, Download.SUCHEN_LADEN, 3)); - try - { - policy.doAction(); - } - catch (Exception e) - { - fail("Fehler: " + e.getMessage()); - e.printStackTrace(); - } - fassade.verify(); - } - - public void testDoFourAction() throws Exception - { - fassade = new ApplejuiceFassadeDummy(new HashMap<String,Download>()); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addDownload(new DownloadDummy(1, 0.0, Download.SUCHEN_LADEN, 1)); - fassade.addDownload(new DownloadDummy(2, 0.0, Download.SUCHEN_LADEN, 1)); - fassade.addDownload(new DownloadDummy(3, 1.3, Download.SUCHEN_LADEN, 1)); - fassade.addDownload(new DownloadDummy(4, 1.4, Download.SUCHEN_LADEN, 1)); - fassade.addExpectedDownload(new DownloadDummy(1, 0.0, Download.PAUSIERT, 1)); - fassade.addExpectedDownload(new DownloadDummy(2, 0.0, Download.PAUSIERT, 1)); - fassade.addExpectedDownload(new DownloadDummy(3, 1.3, Download.PAUSIERT, 1)); - fassade.addExpectedDownload(new DownloadDummy(4, 1.4, Download.SUCHEN_LADEN, 3)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoActionGroesse() throws Exception - { - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addDownload(new DownloadDummy(1, 10.0, Download.SUCHEN_LADEN, 1, 10)); - fassade.addDownload(new DownloadDummy(2, 10.0, Download.SUCHEN_LADEN, 1, 20)); - fassade.addDownload(new DownloadDummy(3, 1.3, Download.SUCHEN_LADEN, 1, 30)); - fassade.addDownload(new DownloadDummy(4, 1.4, Download.SUCHEN_LADEN, 1, 40)); - fassade.addDownload(new DownloadDummy(5, 10.0, Download.SUCHEN_LADEN, 1, 15)); - fassade.addExpectedDownload(new DownloadDummy(1, 10.0, Download.PAUSIERT, 1, 10)); - fassade.addExpectedDownload(new DownloadDummy(2, 10.0, Download.SUCHEN_LADEN, 3, 20)); - fassade.addExpectedDownload(new DownloadDummy(3, 1.3, Download.PAUSIERT, 1, 30)); - fassade.addExpectedDownload(new DownloadDummy(4, 1.4, Download.PAUSIERT, 1, 40)); - fassade.addExpectedDownload(new DownloadDummy(5, 10.0, Download.PAUSIERT, 1, 15)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoActionGroesseProzentSourcen() throws Exception - { - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 3, 3, GROESSE_PROZENT_SOURCEN); - - fassade.addDownload(new DownloadDummy(1, 20.0, Download.SUCHEN_LADEN, 1, 30, EINE_QUELLE)); - fassade.addDownload(new DownloadDummy(2, 99.0, Download.SUCHEN_LADEN, 1, 30, EINE_QUELLE)); - fassade.addDownload(new DownloadDummy(3, 20.0, Download.SUCHEN_LADEN, 1, 30, ZWEI_QUELLEN)); - fassade.addDownload(new DownloadDummy(4, 20.0, Download.SUCHEN_LADEN, 1, 40, EINE_QUELLE)); - fassade.addDownload(new DownloadDummy(5, 20.0, Download.SUCHEN_LADEN, 1, 30, EINE_QUELLE)); - - fassade.addExpectedDownload(new DownloadDummy(1, 20.0, Download.PAUSIERT, 1, 30, EINE_QUELLE)); - fassade.addExpectedDownload(new DownloadDummy(2, 99.0, Download.SUCHEN_LADEN, 3, 30, EINE_QUELLE)); - fassade.addExpectedDownload(new DownloadDummy(3, 20.0, Download.SUCHEN_LADEN, 3, 30, ZWEI_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(4, 20.0, Download.SUCHEN_LADEN, 3, 40, EINE_QUELLE)); - fassade.addExpectedDownload(new DownloadDummy(5, 20.0, Download.PAUSIERT, 1, 30, EINE_QUELLE)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoActionProzentUndSourcen() throws Exception - { - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addDownload(new DownloadDummy(1, 10.0, Download.SUCHEN_LADEN, 1, 100, EINE_QUELLE)); - fassade.addDownload(new DownloadDummy(2, 10.0, Download.SUCHEN_LADEN, 1, 20, VIER_QUELLEN)); - fassade.addDownload(new DownloadDummy(3, 1.3, Download.SUCHEN_LADEN, 1, 30, ZWEI_QUELLEN)); - fassade.addDownload(new DownloadDummy(4, 1.4, Download.SUCHEN_LADEN, 1, 40, DREI_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(1, 10.0, Download.PAUSIERT, 1, 100, EINE_QUELLE)); - fassade.addExpectedDownload(new DownloadDummy(2, 10.0, Download.SUCHEN_LADEN, 3, 20, VIER_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(3, 1.3, Download.PAUSIERT, 1, 30, ZWEI_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(4, 1.4, Download.PAUSIERT, 1, 40, DREI_QUELLEN)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoActionQuellen() throws Exception - { - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 2, 3, SOURCEN_PROZENT_GROESSE); - - fassade.addDownload(new DownloadDummy(1, 90.0, Download.SUCHEN_LADEN, 1, 30, ZWEI_QUELLEN)); - fassade.addDownload(new DownloadDummy(2, 90.0, Download.SUCHEN_LADEN, 1, 30, EINE_QUELLE)); - fassade.addDownload(new DownloadDummy(3, 30.0, Download.SUCHEN_LADEN, 1, 10, VIER_QUELLEN)); - fassade.addDownload(new DownloadDummy(4, 40.0, Download.SUCHEN_LADEN, 1, 10, DREI_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(1, 90.0, Download.PAUSIERT, 1, 30, ZWEI_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(2, 90.0, Download.PAUSIERT, 1, 30, EINE_QUELLE)); - fassade.addExpectedDownload(new DownloadDummy(3, 30.0, Download.SUCHEN_LADEN, 3, 10, VIER_QUELLEN)); - fassade.addExpectedDownload(new DownloadDummy(4, 40.0, Download.SUCHEN_LADEN, 3, 10, DREI_QUELLEN)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoAction() throws Exception - { - fassade = new ApplejuiceFassadeDummy(); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addDownload(new DownloadDummy(1, Download.SUCHEN_LADEN, 1, 10)); - fassade.addDownload(new DownloadDummy(2, Download.SUCHEN_LADEN, 1, 20)); - fassade.addExpectedDownload(new DownloadDummy(1, Download.PAUSIERT, 1, 10)); - fassade.addExpectedDownload(new DownloadDummy(2, Download.SUCHEN_LADEN, 3, 20)); - - policy.doAction(); - fassade.verify(); - - fassade.addDownload(new DownloadDummy(3, 0.0, Download.SUCHEN_LADEN, 1)); - fassade.addExpectedDownload(new DownloadDummy(3, 0.0, Download.PAUSIERT, 1)); - - policy.doAction(); - fassade.verify(); - } - - public void testDoNextAction() throws Exception - { - Map<String,Download> downloads = new HashMap<String,Download>(); - downloads.put(Integer.toString(1), new DownloadDummy(new Integer(1), "bla1", 1.1, Download.SUCHEN_LADEN, 1)); - downloads.put(Integer.toString(2), new DownloadDummy(new Integer(2), "bla2", 1.2, Download.SUCHEN_LADEN, 1)); - downloads.put(Integer.toString(3), new DownloadDummy(new Integer(3), "bla3", 1.3, Download.PAUSIERT, 3)); - downloads.put(Integer.toString(4), new DownloadDummy(new Integer(4), "bla4", 1.4, Download.FERTIG, 1)); - - fassade = new ApplejuiceFassadeDummy(downloads); - policy = new StandardAutomaticPwdlPolicy(fassade, 2, 3, PROZENT_SOURCEN_GROESSE); - - policy.doAction(); - - fassade.addExpectedDownload(new DownloadDummy(new Integer(1), "bla1", 1.1, Download.PAUSIERT, 1)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(2), "bla2", 1.2, Download.SUCHEN_LADEN, 3)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(3), "bla3", 1.3, Download.SUCHEN_LADEN, 3)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(4), "bla4", 1.4, Download.FERTIG, 1)); - - fassade.verify(); - } - - public void testDoEndeAction() throws Exception - { - Map<String,Download> downloads = new HashMap<String,Download>(); - downloads.put(Integer.toString(1), new DownloadDummy(new Integer(1), "bla1", 1.1, Download.FERTIG, 1)); - downloads.put(Integer.toString(2), new DownloadDummy(new Integer(2), "bla2", 1.2, Download.FERTIG, 1)); - downloads.put(Integer.toString(3), new DownloadDummy(new Integer(3), "bla3", 1.3, Download.FERTIG, 3)); - downloads.put(Integer.toString(4), new DownloadDummy(new Integer(4), "bla4", 1.4, Download.FERTIG, 1)); - - fassade = new ApplejuiceFassadeDummy(downloads); - policy = new StandardAutomaticPwdlPolicy(fassade, 2, 3, PROZENT_SOURCEN_GROESSE); - - policy.doAction(); - - fassade.addExpectedDownload(new DownloadDummy(new Integer(1), "bla1", 1.1, Download.FERTIG, 1)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(2), "bla2", 1.2, Download.FERTIG, 1)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(3), "bla3", 1.3, Download.FERTIG, 3)); - fassade.addExpectedDownload(new DownloadDummy(new Integer(4), "bla4", 1.4, Download.FERTIG, 1)); - - fassade.verify(); - } - - public void testDoActionOneAdded() throws Exception - { - fassade = new ApplejuiceFassadeDummy(new HashMap<String,Download>()); - policy = new StandardAutomaticPwdlPolicy(fassade, 1, 3, PROZENT_SOURCEN_GROESSE); - - fassade.addDownload(new DownloadDummy(1, 10.0, Download.SUCHEN_LADEN, 1)); - fassade.addDownload(new DownloadDummy(2, 10.0, Download.SUCHEN_LADEN, 1)); - fassade.addExpectedDownload(new DownloadDummy(1, 10.0, Download.SUCHEN_LADEN, 3)); - fassade.addExpectedDownload(new DownloadDummy(2, 10.0, Download.PAUSIERT, 1)); - - policy.doAction(); - fassade.verify(); - - fassade.addDownload(new DownloadDummy(3, 0.0, Download.SUCHEN_LADEN, 1)); - fassade.addExpectedDownload(new DownloadDummy(3, 0.0, Download.PAUSIERT, 1)); - - policy.doAction(); - fassade.verify(); - } - - public void testGetVersion() - { - assertNotNull("Version ist nicht gesetzt!", policy.getVersion()); - assertTrue("Version ist \"\"!", policy.getVersion().length()>0); - } - - public void testGetDescription() - { - assertNotNull("Description ist nicht gesetzt!", policy.getDescription()); - assertTrue("Description ist \"\"!", policy.getDescription().length()>0); - } - - public void testGetAuthor() - { - assertNotNull("Autor ist nicht gesetzt!", policy.getAuthor()); - assertTrue("Autor ist \"\"!", policy.getAuthor().length()>0); - } - -} diff --git a/AJClientGUI/pwdlpolicies/StandardPwdlPolicy.jar b/AJClientGUI/pwdlpolicies/StandardPwdlPolicy.jar deleted file mode 100644 index 103c4b31..00000000 Binary files a/AJClientGUI/pwdlpolicies/StandardPwdlPolicy.jar and /dev/null differ diff --git a/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClient.java b/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClient.java deleted file mode 100644 index a23a06c2..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClient.java +++ /dev/null @@ -1,742 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client; - -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.HeadlessException; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Toolkit; -import java.awt.event.KeyEvent; - -import java.io.BufferedReader; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintStream; - -import java.net.Socket; - -import java.text.SimpleDateFormat; - -import java.util.Date; -import java.util.StringTokenizer; - -import javax.swing.ImageIcon; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; - -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.FileAppender; -import org.apache.log4j.HTMLLayout; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.PatternLayout; - -import de.applejuicenet.client.fassade.ApplejuiceFassade; -import de.applejuicenet.client.fassade.controller.CoreConnectionSettingsHolder; -import de.applejuicenet.client.fassade.exception.IllegalArgumentException; -import de.applejuicenet.client.fassade.shared.AJSettings; -import de.applejuicenet.client.fassade.shared.ProxySettings; -import de.applejuicenet.client.fassade.shared.WebsiteContentLoader; -import de.applejuicenet.client.gui.AppleJuiceDialog; -import de.applejuicenet.client.gui.UpdateInformationDialog; -import de.applejuicenet.client.gui.components.listener.KeyStates; -import de.applejuicenet.client.gui.connect.ConnectFrame; -import de.applejuicenet.client.gui.connect.QuickConnectionSettingsDialog; -import de.applejuicenet.client.gui.controller.LanguageSelector; -import de.applejuicenet.client.gui.controller.LinkListener; -import de.applejuicenet.client.gui.controller.OptionsManagerImpl; -import de.applejuicenet.client.gui.controller.PositionManager; -import de.applejuicenet.client.gui.controller.PositionManagerImpl; -import de.applejuicenet.client.gui.controller.ProxyManagerImpl; -import de.applejuicenet.client.gui.wizard.WizardDialog; -import de.applejuicenet.client.shared.ConnectionSettings; -import de.applejuicenet.client.shared.IconManager; -import de.applejuicenet.client.shared.SoundPlayer; -import de.applejuicenet.client.shared.Splash; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClient.java,v 1.109 2009/02/12 13:11:40 maj0r Exp $ - * - * <p>Titel: AppleJuice Client-GUI</p> - * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> - * <p>Copyright: General Public License</p> - * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class AppleJuiceClient -{ - public static Splash splash = null; - private static Logger logger = Logger.getLogger(AppleJuiceClient.class); - private static String fileAppenderPath; - private static HTMLLayout layout; - private static ApplejuiceFassade ajFassade = null; - private static CoreConnectionSettingsHolder conn = null; - private static String rootDirectory = null; - - /** - * @return Returns the path of the Client-GUI. - */ - public static String getPath() - { - return getRootDirectory(); - } - - public static synchronized ApplejuiceFassade getAjFassade() - { - if(ajFassade == null) - { - ConnectionSettings rm = OptionsManagerImpl.getInstance().getRemoteSettings(); - - try - { - conn = new CoreConnectionSettingsHolder(rm.getHost(), new Integer(rm.getXmlPort()), rm.getOldPassword(), false); - ajFassade = new ApplejuiceFassade(conn); - } - catch(IllegalArgumentException e) - { - logger.error(e); - } - } - - return ajFassade; - } - - public static CoreConnectionSettingsHolder getCoreConnectionSettingsHolder() - { - return conn; - } - - public static HTMLLayout getLoggerHtmlLayout() - { - return layout; - } - - public static String getLoggerFileAppenderPath() - { - return fileAppenderPath; - } - - public static void main(String[] args) - { - AppleJuiceClientTG tg = new AppleJuiceClientTG(); - final String[] myargs = args; - Runnable runnable = new Runnable() - { - public void run() - { - AppleJuiceClient.runmain(myargs); - } - }; - - Thread t = new Thread(tg, runnable, "appleJuiceCoreGUI"); - - t.start(); - } - - public static void runmain(String[] args) - { - StringBuffer version = new StringBuffer(System.getProperty("java.version")); - - for(int i = version.length() - 1; i >= 0; i--) - { - if(version.charAt(i) == '.') - { - version.deleteCharAt(i); - } - } - - boolean gueltig = false; - - try - { - int versionsNr = Integer.parseInt(version.toString().substring(0, 2)); - - if(versionsNr >= 15) - { - gueltig = true; - } - } - catch(Exception e) - { - ; - - //nix zu tun - } - - if(!gueltig) - { - JOptionPane.showMessageDialog(new Frame(), "Es wird mindestens JRE 5 benoetigt!", "appleJuice Client", - JOptionPane.ERROR_MESSAGE); - System.exit(-1); - } - - boolean processLink = false; - String link = ""; - boolean doubleInstance = false; - LinkListener linkListener = null; - - if(args != null && args.length > 0) - { - try - { - for(String curArg : args) - { - if(curArg.indexOf("-path=") != -1) - { - System.setProperty("user.dir", curArg.substring(6)); - break; - } - } - - boolean hilfeAusgegeben = false; - - for(String curArg : args) - { - if(curArg.compareTo("-help") == 0) - { - if(hilfeAusgegeben) - { - continue; - } - - System.out.println(); - System.out.println(" -help Diese Uebersicht."); - System.out.println(" -path=<pfad> Ausfuehrpfad setzen. Alles im GUI ist relativ zu diesem."); - System.out.println(" -link=<md5Passwort|link> ajfsp-Link ans GUI uebergeben. " + - " Das GUI wird ggf gestartet."); - System.out.println(); - hilfeAusgegeben = true; - } - else if(curArg.indexOf("-command=") != -1) - { - if(linkListener == null) - { - try - { - linkListener = new LinkListener(); - } - catch(IOException ex) - { - //bereits ein GUI vorhanden, also GUI schliessen - doubleInstance = true; - } - } - - if(doubleInstance) - { - int PORT = OptionsManagerImpl.getInstance().getLinkListenerPort(); - String passwort = OptionsManagerImpl.getInstance().getRemoteSettings().getOldPassword(); - Socket socket = new Socket("localhost", PORT); - PrintStream out = new PrintStream(socket.getOutputStream()); - DataInputStream in = new DataInputStream(socket.getInputStream()); - - out.println(passwort + "|" + curArg); - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - String line = reader.readLine(); - - System.out.println(line); - socket.close(); - System.exit(1); - } - else - { - System.out.println("appleJuice-JavaGUI nicht gestartet"); - System.exit(1); - } - } - else if(curArg.indexOf("-link=") != -1 && curArg.length() > "-link=".length() + 1) - { - link = curArg.substring(curArg.indexOf("-link=") + "-link=".length()); - if(linkListener == null) - { - try - { - linkListener = new LinkListener(); - } - catch(IOException ex) - { - //bereits ein GUI vorhanden, also GUI schliessen - doubleInstance = true; - } - } - - if(doubleInstance) - { - int PORT = OptionsManagerImpl.getInstance().getLinkListenerPort(); - String passwort = OptionsManagerImpl.getInstance().getRemoteSettings().getOldPassword(); - Socket socket = new Socket("localhost", PORT); - PrintStream out = new PrintStream(socket.getOutputStream()); - - out.println(passwort + "|" + curArg); - socket.close(); - //war nur Linkprocessing, also GUI schliessen - System.exit(1); - } - else - { - linkListener.processLink(link, ""); - } - } - } - } - catch(IOException ioE) - { - //Keine bisherige GUI-Instanz vorhanden, also GUI oeffnen - processLink = true; - } - catch(Exception e) - { - System.exit(1); - } - } - - if(linkListener == null) - { - try - { - linkListener = new LinkListener(); - } - catch(IOException ex) - { - //bereits ein GUI vorhanden, also GUI schliessen - doubleInstance = true; - } - } - - if(doubleInstance) - { - //bereits ein GUI vorhanden, also GUI schliessen - JOptionPane.showMessageDialog(new Frame(), "Eine Instanz des GUIs ist bereits in Verwendung.", "appleJuice Client", - JOptionPane.ERROR_MESSAGE); - System.exit(1); - } - - if(processLink) - { - linkListener.processLink(link, ""); - } - - boolean isDebug = System.getProperty("Debug") != null; - - if(isDebug) - { - ConsoleAppender consoleAppender = new ConsoleAppender(new PatternLayout("%d [%t] %-5p %c - %m%n")); - - Logger.getRootLogger().addAppender(consoleAppender); - Logger.getRootLogger().setLevel(Level.DEBUG); - } - else - { - Logger rootLogger = Logger.getRootLogger(); - - String datum = new SimpleDateFormat("ddMMyyyy_HHmmss").format(new Date(System.currentTimeMillis())); - String dateiName; - - dateiName = datum + ".html"; - layout = new HTMLLayout(); - layout.setTitle("appleJuice-GUI-Log " + datum); - layout.setLocationInfo(true); - Level logLevel = OptionsManagerImpl.getInstance().getLogLevel(); - - try - { - String path = getRootDirectory() + File.separator + "logs"; - File aFile = new File(path); - - if(!aFile.exists()) - { - aFile.mkdir(); - } - - fileAppenderPath = path + File.separator + dateiName; - if(logLevel != Level.OFF) - { - FileAppender fileAppender = new FileAppender(layout, fileAppenderPath); - - rootLogger.removeAllAppenders(); - rootLogger.addAppender(fileAppender); - } - } - catch(IOException ioe) - { - ioe.printStackTrace(); - } - - rootLogger.setLevel(logLevel); - } - - try - { - String nachricht = "appleJuice-GUI " + AppleJuiceDialog.GUI_VERSION + "/" + ApplejuiceFassade.FASSADE_VERSION + - " wird gestartet..."; - ConnectFrame connectFrame = new ConnectFrame(); - - splash = new Splash(connectFrame, ((ImageIcon) IconManager.getInstance().getIcon("splashscreen")).getImage(), 0, 100); - KeyStates ks = new KeyStates(); - - splash.addKeyListener(ks); - splash.setVisible(true); - try - { - if(OptionsManagerImpl.getInstance().isThemesSupported()) - { - java.lang.reflect.Method method = JFrame.class.getMethod("setDefaultLookAndFeelDecorated", - new Class[] {boolean.class}); - - method.invoke(null, new Object[] {Boolean.TRUE}); - - method = JDialog.class.getMethod("setDefaultLookAndFeelDecorated", new Class[] {boolean.class}); - method.invoke(null, new Object[] {Boolean.TRUE}); - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.FATAL)) - { - logger.fatal("Programmabbruch", e); - } - } - - if(logger.isEnabledFor(Level.INFO)) - { - logger.info(nachricht); - } - - System.out.println(nachricht); - if(logger.isEnabledFor(Level.INFO)) - { - nachricht = "erkanntes GUI-OS: " + System.getProperty("os.name"); - logger.info(nachricht); - nachricht = "erkannte Java-Version: " + System.getProperty("java.version"); - logger.info(nachricht); - } - - String titel = null; - LanguageSelector languageSelector = LanguageSelector.getInstance(); - QuickConnectionSettingsDialog remoteDialog = null; - - splash.setProgress(5, "Lade Themes..."); - AppleJuiceDialog.initThemes(); - splash.setProgress(10, "Teste Verbindung..."); - boolean showDialog = OptionsManagerImpl.getInstance().shouldShowConnectionDialogOnStartup(); - boolean keyDown = ks.isKeyDown(KeyEvent.VK_SHIFT); - - if(!showDialog) - { - showDialog = keyDown; - } - - boolean firstTry = keyDown ? false : true; - int erreichbarkeit = 2; - - if(ajFassade == null) - { - getAjFassade(); - } - while(showDialog || (erreichbarkeit = ajFassade.isCoreAvailable()) != 0) - { - splash.setVisible(false); - if(!showDialog) - { - if(erreichbarkeit == 2) - { - titel = languageSelector.getFirstAttrbuteByTagName("mainform.caption"); - nachricht = languageSelector.getFirstAttrbuteByTagName("javagui.startup.fehlversuch"); - SoundPlayer.getInstance().playSound(SoundPlayer.VERWEIGERT); - JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.ERROR_MESSAGE); - } - else - { - titel = languageSelector.getFirstAttrbuteByTagName("mainform.caption"); - nachricht = languageSelector.getFirstAttrbuteByTagName("mainform.msgdlgtext3"); - SoundPlayer.getInstance().playSound(SoundPlayer.VERWEIGERT); - JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.ERROR_MESSAGE); - } - } - - showDialog = false; - remoteDialog = new QuickConnectionSettingsDialog(connectFrame); - if(firstTry && OptionsManagerImpl.getInstance().isErsterStart()) - { - firstTry = false; - remoteDialog.setNieWiederAnzeigen(); - remoteDialog.pressOK(); - } - else - { - remoteDialog.setVisible(true); - if(remoteDialog.getResult() == QuickConnectionSettingsDialog.ABGEBROCHEN) - { - nachricht = languageSelector.getFirstAttrbuteByTagName("javagui.startup.verbindungsfehler"); - nachricht = nachricht.replaceFirst("%s", OptionsManagerImpl.getInstance().getRemoteSettings().getHost()); - JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.OK_OPTION); - logger.fatal(nachricht); - System.out.println("Fehler: " + nachricht); - System.exit(-1); - } - } - - splash.setVisible(true); - } - - SoundPlayer.getInstance().playSound(SoundPlayer.ZUGANG_GEWAEHRT); - - splash.setProgress(20, "Lade Hauptdialog..."); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - final AppleJuiceDialog theApp = new AppleJuiceDialog(); - - splash.setProgress(100, "GUI geladen..."); - PositionManager lm = PositionManagerImpl.getInstance(); - - if(lm.isLegal()) - { - theApp.setLocation(lm.getMainXY()); - theApp.setSize(lm.getMainDimension()); - } - else - { - Toolkit tk = Toolkit.getDefaultToolkit(); - Dimension screenSize = tk.getScreenSize(); - Dimension appScreenSize = new Dimension(screenSize.width, screenSize.height); - Insets insets = tk.getScreenInsets(theApp.getGraphicsConfiguration()); - - appScreenSize.width -= (insets.left + insets.right); - appScreenSize.width = appScreenSize.width / 5 * 4; - appScreenSize.height -= (insets.top + insets.bottom); - appScreenSize.height = appScreenSize.height / 5 * 4; - Point location = new Point((screenSize.width - appScreenSize.width) / 2, - (screenSize.height - appScreenSize.height) / 2); - - lm.setMainXY(location); - lm.setMainDimension(appScreenSize); - theApp.setSize(appScreenSize); - theApp.setLocation(location); - } - - theApp.setVisible(true); - String nachricht = "appleJuice-GUI gestartet..."; - - if(logger.isEnabledFor(Level.INFO)) - { - logger.info(nachricht); - } - - System.out.println(nachricht); - splash.dispose(); - if(OptionsManagerImpl.getInstance().isErsterStart()) - { - showConnectionWizard(theApp); - } - - Thread versionWorker = new Thread() - { - public void run() - { - if(logger.isEnabledFor(Level.DEBUG)) - { - logger.debug("VersionWorkerThread gestartet. " + this); - } - - try - { - ProxySettings proxy = ProxyManagerImpl.getInstance().getProxySettings(); - String downloadData = WebsiteContentLoader.getWebsiteContent(proxy, "http://www.tkl-soft.de", 80, - "/applejuice/version.txt"); - - if(downloadData.length() > 0) - { - int pos1 = downloadData.indexOf("|"); - final String aktuellsteVersion = downloadData.substring(0, pos1); - StringTokenizer token1 = new StringTokenizer(aktuellsteVersion, "."); - String guiVersion = AppleJuiceDialog.GUI_VERSION; - - if(guiVersion.indexOf('-') != -1) - { - guiVersion = guiVersion.substring(0, guiVersion.indexOf('-')); - } - - StringTokenizer token2 = new StringTokenizer(guiVersion, "."); - - if(token1.countTokens() != 3 || token2.countTokens() != 3) - { - return; - } - - String[] versionInternet = new String[3]; - String[] aktuelleVersion = new String[3]; - - for(int i = 0; i < 3; i++) - { - versionInternet[i] = token1.nextToken(); - aktuelleVersion[i] = token2.nextToken(); - } - - int versionsInfoModus = OptionsManagerImpl.getInstance().getVersionsinfoModus(); - boolean showInfo = false; - boolean versionUpdate = false; - boolean importantUpdate = false; - boolean cosmeticUpdate = false; - - if(Integer.parseInt(versionInternet[0]) > Integer.parseInt(aktuelleVersion[0])) - { - versionUpdate = true; - } - else if(Integer.parseInt(versionInternet[1]) > Integer.parseInt(aktuelleVersion[1])) - { - importantUpdate = true; - } - else if(Integer.parseInt(versionInternet[2]) > Integer.parseInt(aktuelleVersion[2])) - { - cosmeticUpdate = true; - } - - if(versionsInfoModus == 2 && (cosmeticUpdate || importantUpdate || versionUpdate)) - { - showInfo = true; - } - else if(versionsInfoModus == 1 && (importantUpdate || versionUpdate)) - { - showInfo = true; - } - else if(versionsInfoModus == 0 && versionUpdate) - { - showInfo = true; - } - - if(showInfo) - { - int pos2 = downloadData.lastIndexOf("|"); - final String winLink = downloadData.substring(pos1 + 1, pos2); - final String sonstigeLink = downloadData.substring(pos2 + 1); - - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - UpdateInformationDialog updateInformationDialog = new UpdateInformationDialog(theApp, - aktuellsteVersion, - winLink, - sonstigeLink); - - updateInformationDialog.setVisible(true); - } - }); - } - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.INFO)) - { - logger.info("Aktualisierungsinformationen konnten nicht geladen werden. Server down?"); - } - } - - if(logger.isEnabledFor(Level.DEBUG)) - { - logger.debug("VersionWorkerThread beendet. " + this); - } - } - }; - - versionWorker.start(); - } - }); - - /** - * erstmal raus mit dem Mobile-Client - */ - - // MobileProxy.getInstance(); - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.FATAL)) - { - logger.fatal("Programmabbruch", e); - } - - System.exit(-1); - } - } - - private static String getRootDirectory() - { - if(rootDirectory == null) - { - if(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) - { - rootDirectory = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui"; - } - else - { - rootDirectory = System.getProperty("user.dir"); - } - } - - return rootDirectory; - } - - public static void showConnectionWizard(JFrame frame) - throws HeadlessException - { - WizardDialog wizardDialog = new WizardDialog(frame, true); - Dimension appDimension = wizardDialog.getSize(); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - - wizardDialog.setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); - wizardDialog.setVisible(true); - } - - public static boolean showConnectionWizard(JDialog dialog, AJSettings ajSettings) - throws HeadlessException - { - WizardDialog wizardDialog = new WizardDialog(dialog, true, ajSettings); - Dimension appDimension = wizardDialog.getSize(); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - - wizardDialog.setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); - wizardDialog.setVisible(true); - return wizardDialog.isRegularClosed(); - } - - public static String getPropertiesPath() - { - if(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) - { - String dir = System.getProperty("user.home") + File.separator + "appleJuice"; - File directory = new File(dir); - - if(!directory.isDirectory()) - { - directory.mkdir(); - } - - dir += File.separator + "gui"; - directory = new File(dir); - if(!directory.isDirectory()) - { - directory.mkdir(); - } - - dir += File.separator + "ajgui.properties"; - return dir; - } - else - { - return System.getProperty("user.dir") + File.separator + "ajgui.properties"; - } - } -} diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/UpdateInformationDialog.java b/AJClientGUI/src/de/applejuicenet/client/gui/UpdateInformationDialog.java deleted file mode 100644 index 711a815b..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/gui/UpdateInformationDialog.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import de.applejuicenet.client.fassade.ApplejuiceFassade; -import de.applejuicenet.client.gui.controller.LanguageSelector; -import de.applejuicenet.client.gui.controller.OptionsManagerImpl; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/src/de/applejuicenet/client/gui/UpdateInformationDialog.java,v 1.11 2009/01/12 09:19:20 maj0r Exp $ - * - * <p>Titel: AppleJuice Client-GUI</p> - * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> - * <p>Copyright: General Public License</p> - * - * @author: Maj0r <aj@tkl-soft.de> - * - */ -public class UpdateInformationDialog extends JDialog -{ - private String aktuellsteVersion; - private JButton schliessen = new JButton(); - private String windowsLink = ""; - private String sonstigeLink = ""; - private Logger logger; - - public UpdateInformationDialog(JFrame parentFrame, String aktuellsteVersion, String winLink, String sonstigeLink) - { - super(parentFrame, true); - logger = Logger.getLogger(getClass()); - try - { - this.aktuellsteVersion = aktuellsteVersion; - this.windowsLink = winLink; - this.sonstigeLink = sonstigeLink; - init(); - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); - } - } - } - - private void init() - { - LanguageSelector ls = LanguageSelector.getInstance(); - - schliessen.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - UpdateInformationDialog.this.dispose(); - } - }); - - String titel = ls.getFirstAttrbuteByTagName("javagui.startup.newversiontitel"); - String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.newversionnachricht"); - - nachricht = nachricht.replaceFirst("%s", aktuellsteVersion); - schliessen.setText(ls.getFirstAttrbuteByTagName("javagui.options.plugins.schliessen")); - setTitle(titel); - JPanel panel1 = new JPanel(new GridBagLayout()); - GridBagConstraints constraints = new GridBagConstraints(); - - constraints.anchor = GridBagConstraints.NORTH; - constraints.fill = GridBagConstraints.BOTH; - constraints.gridx = 0; - constraints.gridy = 0; - constraints.gridwidth = 3; - constraints.insets.left = 5; - constraints.insets.top = 5; - constraints.insets.right = 5; - panel1.add(new JLabel(nachricht), constraints); - constraints.insets.right = 0; - constraints.gridwidth = 1; - constraints.gridy = 1; - JLabel label1 = new JLabel(); - - label1.setText(ls.getFirstAttrbuteByTagName("javagui.startup.windowsversion") + ": "); - JLabel linkWin = new JLabel("<html><font><u>" + windowsLink + "</u></font></html>"); - - panel1.add(label1, constraints); - constraints.gridx = 1; - panel1.add(linkWin, constraints); - constraints.gridx = 2; - constraints.weightx = 1; - constraints.insets.right = 5; - panel1.add(new JLabel(), constraints); - constraints.insets.right = 0; - constraints.weightx = 0; - constraints.gridx = 0; - constraints.gridy = 2; - constraints.insets.bottom = 5; - JLabel label2 = new JLabel(); - - label2.setText(ls.getFirstAttrbuteByTagName("javagui.startup.sonstigeversionen") + ": "); - JLabel linkSonstige = new JLabel("<html><font><u>" + sonstigeLink + "</u></font></html>"); - - panel1.add(label2, constraints); - constraints.gridx = 1; - panel1.add(linkSonstige, constraints); - constraints.gridx = 2; - constraints.weightx = 1; - constraints.insets.right = 5; - panel1.add(new JLabel(), constraints); - constraints.insets.right = 0; - constraints.weightx = 0; - - linkWin.setForeground(Color.blue); - linkWin.addMouseListener(new MouseAdapter() - { - public void mouseExited(MouseEvent e) - { - setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); - } - - public void mouseEntered(MouseEvent e) - { - setCursor(new Cursor(Cursor.HAND_CURSOR)); - } - - public void mouseClicked(MouseEvent e) - { - executeLink(windowsLink); - } - }); - - linkSonstige.setForeground(Color.blue); - linkSonstige.addMouseListener(new MouseAdapter() - { - public void mouseExited(MouseEvent e) - { - setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); - } - - public void mouseEntered(MouseEvent e) - { - setCursor(new Cursor(Cursor.HAND_CURSOR)); - } - - public void mouseClicked(MouseEvent e) - { - executeLink(sonstigeLink); - } - }); - - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(panel1, BorderLayout.CENTER); - JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - southPanel.add(schliessen); - getContentPane().add(southPanel, BorderLayout.SOUTH); - pack(); - Dimension appDimension = getSize(); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - - setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); - } - - private void executeLink(String link) - { - try - { - String browser = OptionsManagerImpl.getInstance().getStandardBrowser(); - - try - { - Runtime.getRuntime().exec(new String[] {browser, link}); - } - catch(Exception ex) - { - LanguageSelector ls = LanguageSelector.getInstance(); - String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.updatefehlernachricht"); - String titel = ls.getFirstAttrbuteByTagName("mainform.caption"); - - setVisible(false); - JOptionPane.showMessageDialog(this, nachricht, titel, JOptionPane.INFORMATION_MESSAGE); - setVisible(true); - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.ERROR)) - { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); - } - } - } -} diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/tray/TrayIF.java b/AJClientGUI/src/de/applejuicenet/client/gui/tray/TrayIF.java deleted file mode 100644 index 82ed5ee2..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/gui/tray/TrayIF.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.gui.tray; - -import java.awt.Image; - -import javax.swing.Icon; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; - -import de.applejuicenet.client.gui.AppleJuiceDialog; - -public interface TrayIF -{ - boolean makeTray(Image image, String title, final AppleJuiceDialog dialog, final JMenuItem popupShowHideMenuItem, - final Icon zeigenIcon, final Icon versteckenIcon, final JPopupMenu popup); - - void setTextVerstecken(String verstecken); - - void setTextZeigen(String zeigen); - - void showBallon(String caption, String message); -} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/DesktopToolIF.java b/AJClientGUI/src/de/applejuicenet/client/shared/DesktopToolIF.java deleted file mode 100644 index 12fde1ce..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/shared/DesktopToolIF.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ -package de.applejuicenet.client.shared; - -import java.io.File; - -import java.net.URI; - -public interface DesktopToolIF -{ - void browse(URI uri); - - void open(File toOpen); -} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/DesktopTools.java b/AJClientGUI/src/de/applejuicenet/client/shared/DesktopTools.java deleted file mode 100644 index bfa6b08f..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/shared/DesktopTools.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.shared; - -import java.io.File; - -import java.net.URI; - -import javax.swing.JOptionPane; - -import de.applejuicenet.client.gui.AppleJuiceDialog; -import de.applejuicenet.client.gui.controller.LanguageSelector; -import de.applejuicenet.client.gui.controller.OptionsManagerImpl; - -@SuppressWarnings("unchecked") -public class DesktopTools -{ - private static DesktopToolIF desktopToolIF; - - static - { - try - { - Class aClass = Class.forName("de.applejuicenet.client.gui.tray.DesktopToolJava6"); - - desktopToolIF = (DesktopToolIF) aClass.newInstance(); - } - catch(Throwable e) - { - desktopToolIF = null; - } - } - - public static boolean isAdvancedSupported() - { - return null != desktopToolIF; - } - - public static void browse(URI uri) - { - if(null != desktopToolIF && System.getProperty("os.name").toLowerCase().indexOf("linux") == -1) - { - /** - * unter Linux ist #browse() teilweise nicht funktionstuechtig... - */ - desktopToolIF.browse(uri); - } - else - { - String browser = OptionsManagerImpl.getInstance().getStandardBrowser(); - - try - { - Runtime.getRuntime().exec(new String[] {browser, uri.toURL().toString()}); - } - catch(Exception ex) - { - LanguageSelector ls = LanguageSelector.getInstance(); - String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.updatefehlernachricht"); - String titel = ls.getFirstAttrbuteByTagName("mainform.caption"); - - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), nachricht, titel, JOptionPane.INFORMATION_MESSAGE); - } - } - } - - public static void open(File toOpen) - { - if(null != desktopToolIF) - { - desktopToolIF.open(toOpen); - } - } -} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/DownloadDO.java b/AJClientGUI/src/de/applejuicenet/client/shared/DownloadDO.java deleted file mode 100644 index 725f0f89..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/shared/DownloadDO.java +++ /dev/null @@ -1,149 +0,0 @@ -package de.applejuicenet.client.shared; - -import java.util.*; - -/** - * <p>Title: AppleJuice Client-GUI</p> - * <p>Description: </p> - * <p>Copyright: Copyright (c) 2003</p> - * <p>Company: </p> - * @author Maj0r - * @version 1.0 - */ - -public class DownloadDO { - public static final int WARTESCHLANGE = 0; - public static final int UEBERTRAGE = 1; - public static final int VERSUCHEINDIREKT = 2; - public static final int ROOT = 3; - - boolean root; - private String dateiname; - private int status; - private String groesse; - private String bereitsGeladen; - private String prozentGeladen; - private String nochZuLaden; - private String geschwindigkeit; - private String restlicheZeit; - private String powerdownload; - private Version version; - private String nick; - private HashSet sources = new HashSet(); //contains DownloadDO leafs - - public DownloadDO(boolean isRoot, String dateiname, int status, - String groesse, - String bereitsGeladen, String prozentGeladen, - String nochZuLaden, String geschwindigkeit, - String restlicheZeit, String powerdownload, - Version version, String nick, HashSet sources) { - root = isRoot; - this.dateiname = dateiname; - this.status = status; - this.groesse = groesse; - this.bereitsGeladen = bereitsGeladen; - this.prozentGeladen = prozentGeladen; - this.nochZuLaden = nochZuLaden; - this.geschwindigkeit = geschwindigkeit; - this.restlicheZeit = restlicheZeit; - this.powerdownload = powerdownload; - this.version = version; - this.nick = nick; - this.sources = sources; - } - - public DownloadDO(){ } - - public void setGroesse(String groesse){ - this.groesse=groesse; - } - - public String getDateiname() { - if (root) { - return dateiname; - } - else { - return dateiname + " (" + getNick() + ")"; - } - } - - public String getNick() { - if (root) { - return ""; - } - else { - return nick; - } - } - - public int getIntStatus() { - return status; - } - - public String getStatus() { - if (status==0) - return "Warteschlange"; - else if (status==1) - return "bertrage"; - else if (status==2) - return "Versuche indirekt zu verbinden"; - else if (status==3) - return ""; - //to do - return ""; - } - - public String getGroesse() { - return groesse; - } - - public String getBereitsGeladen() { - return bereitsGeladen; - } - - public String getProzentGeladen() { - //to do - return prozentGeladen; - } - - public String getNochZuLaden() { - //to do - return nochZuLaden; - } - - public String getGeschwindigkeit() { - //to do - return geschwindigkeit; - } - - public String getRestlicheZeit() { - //to do - return restlicheZeit; - } - - public String getPowerdownload() { - return powerdownload; - } - - public Version getVersion() { - //to do - return version; - } - - public void addDownloadSource(DownloadDO source) { - if (! (sources.contains(source))) { - sources.add(source); - } - } - - public DownloadDO[] getSources() { - if (sources==null) - return null; - return (DownloadDO[]) sources.toArray(new DownloadDO[sources. - size()]); - } - - public String toString() { - return getDateiname(); - } -} \ No newline at end of file diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/IconManager.java b/AJClientGUI/src/de/applejuicenet/client/shared/IconManager.java deleted file mode 100644 index 5f6e41d0..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/shared/IconManager.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.shared; - -import java.awt.Image; -import java.awt.Toolkit; - -import java.io.File; -import java.io.FileInputStream; - -import java.net.URL; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import javax.swing.ImageIcon; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -/** - * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/src/de/applejuicenet/client/shared/IconManager.java,v 1.17 2009/01/07 15:21:33 maj0r Exp $ - * - * <p>Titel: AppleJuice Client-GUI</p> - * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> - * <p>Copyright: General Public License</p> - * - * @author: Maj0r [aj@tkl-soft.de] - * - */ -public class IconManager -{ - private static IconManager instance = null; - private final Logger logger; - private Map<String, ImageIcon> icons; - private String pluginPath; - - private IconManager() - { - logger = Logger.getLogger(getClass()); - icons = new HashMap<String, ImageIcon>(); - if(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) - { - pluginPath = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui" + File.separator + - "plugins" + File.separator; - } - else - { - pluginPath = System.getProperty("user.dir") + File.separator + "plugins" + File.separator; - } - } - - public static IconManager getInstance() - { - if(instance == null) - { - instance = new IconManager(); - } - - return instance; - } - - public ImageIcon getIcon(String key) - { - ImageIcon result = null; - - try - { - String hashtableKey = key; - - if(icons.containsKey(hashtableKey)) - { - result = icons.get(hashtableKey); - } - else - { - String path = System.getProperty("user.dir") + File.separator + "icons" + File.separator + key + ".gif"; - Image img = Toolkit.getDefaultToolkit().getImage(path); - - result = new ImageIcon(img); - icons.put(hashtableKey, result); - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.INFO)) - { - logger.info("Icon " + key + ".gif nicht gefunden", e); - } - } - - return result; - } - - @SuppressWarnings("unchecked") - public ImageIcon getIcon(String key, boolean isPlugin, Class referenceClass) - { - if(!isPlugin) - { - return getIcon(key); - } - - ImageIcon result = null; - - try - { - result = icons.get(key); - if(null == result) - { - URL url = referenceClass.getClassLoader().getResource(key + ".gif"); - - Image img = Toolkit.getDefaultToolkit().getImage(url); - - result = new ImageIcon(img); - icons.put(key, result); - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.INFO)) - { - logger.info("Plugin-Icon " + key + ".gif nicht gefunden", e); - } - } - - return result; - } - - public Properties getIconProperties(String identifier) - { - String path = System.getProperty("user.dir") + File.separator + "icons" + File.separator + identifier + ".properties"; - File aFile = new File(path); - - if(aFile.isFile()) - { - Properties props = new Properties(); - - try - { - props.load(new FileInputStream(aFile)); - } - catch(Exception e) - { - return null; - } - - return props; - } - else - { - return null; - } - } -} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/ReleaseInfoDialog.java b/AJClientGUI/src/de/applejuicenet/client/shared/ReleaseInfoDialog.java deleted file mode 100644 index 8ce5cfa2..00000000 --- a/AJClientGUI/src/de/applejuicenet/client/shared/ReleaseInfoDialog.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.shared; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.net.URLConnection; -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextPane; -import javax.swing.SwingUtilities; - -import org.apache.log4j.Logger; - -import de.applejuicenet.client.AppleJuiceClient; -import de.applejuicenet.client.fassade.exception.IllegalArgumentException; -import de.applejuicenet.client.fassade.shared.ProxySettings; -import de.applejuicenet.client.fassade.shared.ReleaseInfo; -import de.applejuicenet.client.gui.AppleJuiceDialog; -import de.applejuicenet.client.gui.controller.LanguageSelector; -import de.applejuicenet.client.gui.controller.ProxyManagerImpl; -import de.applejuicenet.client.gui.start.HyperlinkAdapter; - -public class ReleaseInfoDialog extends JDialog { - - private static Logger logger = Logger.getLogger(ReleaseInfoDialog.class); - private JTextPane txtContent; - private final ReleaseInfo releaseInfo; - private final boolean downloadOption; - private final String filename; - private final Long size; - - private ReleaseInfoDialog(ReleaseInfo releaseInfo, boolean downloadOption, - String filename, Long size) { - super(AppleJuiceDialog.getApp(), releaseInfo.getTitle(), true); - this.releaseInfo = releaseInfo; - this.downloadOption = downloadOption; - this.filename = filename; - this.size = size; - init(); - pack(); - setSize(700, 600); - setLocationRelativeTo(AppleJuiceDialog.getApp()); - setVisible(true); - } - - private void init() { - LanguageSelector languageSelector = LanguageSelector.getInstance(); - String txtCategories = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.categories"); - String txtFormat = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.format"); - String txtViewed = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.viewed"); - String txtCount = - languageSelector.getFirstAttrbuteByTagName("releaseinfo.count"); - String txtClicks = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.clicks"); - String txtPublished = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.published"); - String txtToday = - languageSelector.getFirstAttrbuteByTagName("releaseinfo.today"); - String txtYesterday = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.yesterday"); - String txtLanguages = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.languages"); - String txtGenres = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.genres"); - String txtRatingVideo = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.rating.video"); - String txtRatingAudio = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.rating.audio"); - String txtFsk18 = - languageSelector.getFirstAttrbuteByTagName("releaseinfo.fsk18"); - String txtJa = - languageSelector.getFirstAttrbuteByTagName("releaseinfo.yes"); - String txtNein = - languageSelector.getFirstAttrbuteByTagName("releaseinfo.no"); - - HyperlinkAdapter hyperlinkAdapter = - new HyperlinkAdapter(getTxtContent()); - - getTxtContent().addHyperlinkListener(hyperlinkAdapter); - - getContentPane().setLayout(new BorderLayout()); - - StringBuilder theContent = new StringBuilder(); - - theContent.append("<html>"); - theContent.append(" <div align=\"center\"><b>"); - if (null != releaseInfo.getDescriptionURL()) { - theContent.append(" <a href=\"" - + releaseInfo.getDescriptionURL().toString() + "\">" - + releaseInfo.getTitle() + "</a>"); - } else { - theContent.append(releaseInfo.getTitle()); - } - - theContent.append(" </b></div>"); - theContent.append(" <table>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtCategories + "</td>"); - theContent.append(" <td>"); - if (null != releaseInfo.getCategory()) { - theContent.append(releaseInfo.getCategory()); - } - - theContent.append(" </td>"); - theContent.append(" <td rowspan=\"8\">"); - if (null != releaseInfo.getImageURL()) { - String link = releaseInfo.getImageURL().toString(); - - theContent.append("<img src=\"" + link + "\">"); - } - - theContent.append(" </td>"); - theContent.append(" </tr>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtFormat + "</td>"); - theContent.append(" <td>"); - if (null != releaseInfo.getFormat()) { - theContent.append(releaseInfo.getFormat()); - } - - theContent.append(" </td>"); - theContent.append(" </tr>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtViewed + "</td>"); - String tmp = txtCount; - - if (null != releaseInfo.getViewsTotal()) { - tmp = tmp.replaceAll("%all", "" + releaseInfo.getViewsTotal()); - } else { - tmp = tmp.replaceAll("%all", "-"); - } - - if (null != releaseInfo.getViewsCurrentMonth()) { - tmp = - tmp.replaceAll("%month", - "" + releaseInfo.getViewsCurrentMonth()); - } else { - tmp = tmp.replaceAll("%month", "-"); - } - - theContent.append(" <td>" + tmp); - theContent.append(" </td>"); - theContent.append(" </tr>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtPublished + "</td>"); - theContent.append(" <td>"); - if (null != releaseInfo.getReleaseDate()) { - Calendar calHeute = Calendar.getInstance(); - Calendar calRelease = Calendar.getInstance(); - - calRelease.setTime(releaseInfo.getReleaseDate()); - if (calHeute.get(Calendar.YEAR) == calRelease.get(Calendar.YEAR) - && calHeute.get(Calendar.DAY_OF_YEAR) == calRelease - .get(Calendar.DAY_OF_YEAR)) { - theContent.append("<b>" + txtToday + "</b> - "); - } else { - calHeute.add(Calendar.DATE, -1); - if (calHeute.get(Calendar.YEAR) == calRelease - .get(Calendar.YEAR) - && calHeute.get(Calendar.DAY_OF_YEAR) == calRelease - .get(Calendar.DAY_OF_YEAR)) { - theContent.append("<b>" + txtYesterday + "</b> - "); - } - } - - SimpleDateFormat formater = - new SimpleDateFormat("dd.MM.yyyy HH:mm"); - - theContent.append(formater.format(releaseInfo.getReleaseDate())); - } - - theContent.append(" </td>"); - theContent.append(" </tr>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtLanguages + "</td>"); - theContent.append(" <td>"); - if (null != releaseInfo.getLanguageImage()) { - String link = releaseInfo.getLanguageImage().toString(); - - theContent.append("<IMG SRC=\"" + link + "\">"); - } - - if (null != releaseInfo.getLanguage()) { - theContent.append(releaseInfo.getLanguage()); - } - - theContent.append(" </td>"); - theContent.append(" </tr>"); - theContent.append(" <tr>"); - theContent.append(" <td>" + txtGenres + "</td>"); - theContent.append(" <td>"); - if (null != releaseInfo.getGenres()) { - int x = 0; - - for (String curGenre : releaseInfo.getGenres()) { - if (x > 0) { - theContent.append(", "); - } - - theContent.append(curGenre); - x++; - } - } - - theContent.append(" </td>"); - theContent.append(" </tr>"); - File imageFileGood = - new File(System.getProperty("user.dir") + File.separator - + "icons" + File.separator + "led_green.gif"); - File imageFileBad = - new File(System.getProperty("user.dir") + File.separator - + "icons" + File.separator + "led_gray.gif"); - - theContent.append(" <tr>"); - theContent.append(" <td>" + txtFsk18 + "</td>"); - theContent.append(" <td>"); - theContent.append(releaseInfo.isFsk18() ? txtJa : txtNein); - theContent.append(" </td>"); - theContent.append(" </tr>"); - - theContent.append(" <tr>"); - theContent.append(" <td>"); - theContent.append("Qualit\u00e4t:"); - theContent.append(" </td>"); - theContent.append(" <td>"); - theContent.append(releaseInfo.getQuality()); - theContent.append(" </td>"); - theContent.append(" </tr>"); - - theContent.append(" </table>"); - theContent.append("</html>"); - ProxySettings proxySettings = - ProxyManagerImpl.getInstance().getProxySettings(); - if (proxySettings != null) { - System.getProperties().put("proxyHost", proxySettings.getHost()); - System.getProperties().put("proxyPort", - Integer.toString(proxySettings.getPort())); - } - - getTxtContent().setContentType("text/html"); - getTxtContent().setText(theContent.toString()); - getTxtContent().setEditable(false); - getTxtContent().setBackground(getBackground()); - getContentPane().add(getTxtContent(), BorderLayout.CENTER); - - JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - IconManager im = IconManager.getInstance(); - - JButton btnClose = new JButton(); - - btnClose.setIcon(im.getIcon("abbrechen")); - btnClose.setText(languageSelector - .getFirstAttrbuteByTagName("assistant.closebutton.caption")); - btnClose.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - setVisible(false); - } - }); - southPanel.add(btnClose); - - JButton btnDownloadImage = new JButton(); - - btnDownloadImage.setIcon(im.getIcon("download")); - btnDownloadImage.setText(languageSelector - .getFirstAttrbuteByTagName("releaseinfo.downloadimage")); - btnDownloadImage.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - downloadImage(); - } - }); - southPanel.add(btnDownloadImage); - - JButton btnBrowseRelease = new JButton(); - - btnBrowseRelease.setIcon(im.getIcon("browsen")); - btnBrowseRelease.setText(languageSelector - .getFirstAttrbuteByTagName("releaseinfo.browse")); - btnBrowseRelease.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - try { - DesktopTools - .browse(releaseInfo.getDescriptionURL().toURI()); - } catch (URISyntaxException e1) { - logger.error(e1.getMessage(), e1); - } - } - }); - southPanel.add(btnBrowseRelease); - - if (downloadOption) { - JButton btnDownload = new JButton(); - - btnDownload.setIcon(im.getIcon("download")); - btnDownload.setText(languageSelector - .getFirstAttrbuteByTagName("mainform.Getlink3.caption")); - btnDownload.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent ae) { - download(); - } - }); - southPanel.add(btnDownload); - } - - getTxtContent().doLayout(); - - getContentPane().add(southPanel, BorderLayout.SOUTH); - // pack(); - } - - protected void download() { - StringBuilder toCopy = new StringBuilder(); - - toCopy.append("ajfsp://file|"); - toCopy.append(filename + "|" + releaseInfo.getMd5() + "|" + size + "/"); - final String link = toCopy.toString(); - - new Thread() { - - public void run() { - try { - final String result = - AppleJuiceClient.getAjFassade().processLink(link, - ""); - - SoundPlayer.getInstance().playSound(SoundPlayer.LADEN); - if (result.indexOf("ok") != 0) { - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - String message = null; - LanguageSelector languageSelector = - LanguageSelector.getInstance(); - - if (result.indexOf("already downloaded") != -1) { - message = - languageSelector - .getFirstAttrbuteByTagName("javagui.downloadform.bereitsgeladen"); - message = message.replaceAll("%s", link); - } else if (result.indexOf("incorrect link") != -1) { - message = - languageSelector - .getFirstAttrbuteByTagName("javagui.downloadform.falscherlink"); - message = message.replaceAll("%s", link); - } else if (result.indexOf("failure") != -1) { - message = - languageSelector - .getFirstAttrbuteByTagName("javagui.downloadform.sonstigerlinkfehlerlang"); - } - - if (message != null) { - JOptionPane.showMessageDialog( - AppleJuiceDialog.getApp(), - message, - languageSelector - .getFirstAttrbuteByTagName("mainform.caption"), - JOptionPane.OK_OPTION - | JOptionPane.INFORMATION_MESSAGE); - } - } - }); - } - } catch (IllegalArgumentException e) { - logger.error(e); - } - } - }.start(); - setVisible(false); - } - - private JTextPane getTxtContent() { - if (null == txtContent) { - txtContent = new JTextPane(); - } - - return txtContent; - } - - public void downloadImage() { - if (null == releaseInfo.getImageURL()) { - return; - } - - try { - final JFileChooser fileChooser = new JFileChooser(); - - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - String defaultFileName = releaseInfo.getImageURL().getFile(); - int index = defaultFileName.lastIndexOf("/"); - - if (index != -1) { - defaultFileName = defaultFileName.substring(index + 1); - } - index = defaultFileName.lastIndexOf("?"); - if (index != -1) { - defaultFileName = defaultFileName.substring(0, index); - } - - fileChooser.setSelectedFile(new File(fileChooser - .getCurrentDirectory().getAbsolutePath() - + File.separator - + defaultFileName)); - - int result = fileChooser.showSaveDialog(this); - - if (result != JFileChooser.APPROVE_OPTION) { - return; - } - - File destFile = fileChooser.getSelectedFile(); - - ProxySettings proxySettings = - ProxyManagerImpl.getInstance().getProxySettings(); - if (proxySettings != null) { - System.getProperties() - .put("proxyHost", proxySettings.getHost()); - System.getProperties().put("proxyPort", - Integer.toString(proxySettings.getPort())); - } - URLConnection urlconnection = - releaseInfo.getImageURL().openConnection(); - if (proxySettings != null) { - urlconnection.setRequestProperty("Proxy-Authorization", - "Basic " + proxySettings.getUserpass()); - } - - urlconnection.setUseCaches(true); - - InputStream urlStream = urlconnection.getInputStream(); - - FileOutputStream fos = new FileOutputStream(destFile); - - int bytesread = 0; - - byte[] buf = new byte[1024]; - while ((bytesread = urlStream.read(buf)) > 0) { - fos.write(buf, 0, bytesread); - } - - fos.close(); - urlStream.close(); - - if (proxySettings != null) { - System.getProperties().remove("proxyHost"); - System.getProperties().remove("proxyPort"); - } - - LanguageSelector languageSelector = LanguageSelector.getInstance(); - String message = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.downloadimage.ok"); - - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), message); - } catch (IOException ioe) { - logger.info(ioe.getMessage(), ioe); - } - } - - public static void showReleaseInfo(String hash) { - showReleaseInfo(hash, false, null, null); - } - - public static void showReleaseInfo(String hash, boolean downloadOption, - String filename, Long size) { - ReleaseInfo releaseInfo = null; - - try { - releaseInfo = - AppleJuiceClient.getAjFassade().getReleaseInfo(hash, - ProxyManagerImpl.getInstance().getProxySettings()); - } catch (Exception e) { - logger.info(e.getMessage(), e); - } - - if (null == releaseInfo) { - LanguageSelector languageSelector = LanguageSelector.getInstance(); - String message = - languageSelector - .getFirstAttrbuteByTagName("releaseinfo.na"); - - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), message); - } else { - new ReleaseInfoDialog(releaseInfo, downloadOption, filename, size); - } - } -} diff --git a/AJClientGUI/themes/readme.first b/AJClientGUI/themes/readme.first deleted file mode 100644 index b6f798c7..00000000 --- a/AJClientGUI/themes/readme.first +++ /dev/null @@ -1,2 +0,0 @@ -Weitere Themes gibts auf http://javootoo.l2fprod.com/plaf/skinlf/index.php . -Es werden nur zip-Formate untersttzt! \ No newline at end of file diff --git a/AJClientGUI/tools/apfel.ico b/AJClientGUI/tools/apfel.ico deleted file mode 100644 index c2d4329d..00000000 Binary files a/AJClientGUI/tools/apfel.ico and /dev/null differ diff --git a/AJClientGUI/tools/pack.jar b/AJClientGUI/tools/pack.jar deleted file mode 100644 index ca3f1a69..00000000 Binary files a/AJClientGUI/tools/pack.jar and /dev/null differ diff --git a/AJClientGUI/wizard.xml b/AJClientGUI/wizard.xml deleted file mode 100644 index 2d2b9a82..00000000 --- a/AJClientGUI/wizard.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<root> - <wizard bezeichnung="Wizard"> - <modem bezeichnung="Modem" maxupload="3" maxdownload="4" maxnewconnections10="25"/> - <isdn bezeichnung="ISDN" maxupload="8" maxdownload="7" maxnewconnections10="50"/> - <dsl768 bezeichnung="DSL 768" maxupload="14" maxdownload="90" maxnewconnections10="50"/> - <dsl1000 bezeichnung="DSL 1000 (1 Mbit)" maxupload="14" maxdownload="120" maxnewconnections10="50"/> - <dsl2000 bezeichnung="DSL 2000 (2 Mbit)" maxupload="21" maxdownload="245" maxnewconnections10="50"/> - <dsl3000 bezeichnung="DSL 3000 (3 Mbit)" maxupload="43" maxdownload="375" maxnewconnections10="50"/> - <dsl6000 bezeichnung="DSL 6000 (6 Mbit)" maxupload="45" maxdownload="760" maxnewconnections10="50"/> - <dsl16000n bezeichnung="DSL 16000 (16 Mbit)" maxupload="110" maxdownload="2000" maxnewconnections10="50"/> - <dsl16000 bezeichnung="Arcor DSL 16000" maxupload="95" maxdownload="2010" maxnewconnections10="50"/> - <t1 bezeichnung="T1" maxupload="67" maxdownload="67" maxnewconnections10="50"/> - <t3 bezeichnung="T3" maxupload="181" maxdownload="181" maxnewconnections10="50"/> - <lan bezeichnung="LAN" maxupload="5600" maxdownload="5600" maxnewconnections10="50"/> - <oc3 bezeichnung="OC3" maxupload="12000" maxdownload="12000" maxnewconnections10="50"/> - </wizard> -</root> diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..e85235ff --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,5 @@ +# Primary Authors + +- Maj0r +- loevenwong +- red171 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..45c2301b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,632 @@ +# Changelog + +**0.83.3** + +- [red171] import der dekompilierten `tklcontrols` +- [red171] alte `AjCoreGUI.exe` wiederhergestellt [#15](../../issues/15) + +**0.83.1** + +- [red171] neues, zeitgemäßes Icon der ausführbaren Dateien und Trayicon +- [red171] Linkübernahme in Browsern auf Basis von Chromium behoben, auch wenn die GUI bereits geöffnet ist [#12](../../issues/12) (Danke an `Pepsi`) +- [red171] der Release Info Button öffnet nun eine konfigurierte URL mit `ajfsp` Link angehängt [#9](../../issues/9) +- [red171] die Konfiguration der Release-Info wird nun ebenfalls im `user.home` gespeichert, außerdem ist der API Pfad konfigurierbar [#9](../../issues/9) +- [red171] Im Upload Tab ist jetzt auch Kontext Menü [#10](../../issues/10) +- [red171] das IRC Plugin wurde entfernt [#3](../../issues/3) +- [red171] für die Updateüberprüfung gibt es nur noch einen an/aus Schalter [#1](../../issues/1) +- [red171] der "neue Version verfügbar" Dialog hat nur noch eine URL und zeigt auf das Github Release [#2](../../issues/2) +- [red171] Gui und Plugins werden mit Maven kompiliert, Pakete (leider) noch via `ant` komprimiert [#4](../../issues/4) +- [red171] alle GUI Plugins mit Java8 und UTF-8 Encoding neu kompiliert, Sprachdateien mit UTF-8 neu kodiert [#4](../../issues/4) + +**0.82.1** + +- [red171] benutze unter Linux [xdg-open](https://wiki.ubuntuusers.de/xdg-utils/#xdg-open) als Standard Browser für URLs + +**0.82.0** + +- [red171] [wizard.xml](./AJClientGUI/wizard.xml) an die aktuellen Gegebenheiten angepasst +- [red171] jegliche Konfigurationsdateien werden jetzt im `user.home` gesichert +- [red171] unter Linux wird jetzt der interne Fenster Titel korrekt gesetzt (für `.desktop` Files wichtig) + +**0.81.1** + +- [red171] Linkübernahme in Browsern auf Basis von Chromium behoben (`%7C` vs `|`) + +**0.80.1** + +- [red171] VCS import +- [red171] JRE Version checker entfernt (so funktioniert das GUI auch mit Java >= 11) +- [red171] Update Checker URL auf github umgestellt +- [red171] ant `build.xml` kompatibilität zu Java 8 hergestellt + +**0.71.1** + +- [Maj0r] Release-Info auf `applefiles.cc` umgestellt + +**0.71.0** + +- [Maj0r] Sortierung der Tabellen wird gespeichert +- [Maj0r] Menüpunkt Release-Info in Share, Suche und Download hinzugefügt +- [Maj0r] Bäume in Suche, Download und Upload durch Tabellen ersetzt + +**0.70.5** + +- [Maj0r] Fehler beim Hinzufügen von Share-Ordnern behoben +- [Maj0r] Priorität der Uploads in der Form 1:2,2 (Priowert) anzeigen +- [Maj0r] Sortierung im Downloadreiter korrigiert + +**0.70.4** + +- [Maj0r] Deadlock beim Start gefixt +- [Maj0r] Anzeige der Downloadgechwindigkeit und des Gesamtdown- und uploads korrigiert +- [Maj0r] PwDl der Uploads in der Form 1:2,2 anzeigen +- [Maj0r] Mit Java6 lassen sich bei lokaler Coreverbindung Sharedateien und laufende Downloads nun mit dem Standardprogramm öffnen +- [Maj0r] Bug #670 Reiter per Tastaturschnelltaste anwaehlbar + +**0.70.2** + +- [Maj0r] Core-Versionsprüfung gefixt + +**0.70.1** + +Java ab 5.0 wird benötigt + +- [Maj0r] TrayIcon von Java6 eingebaut und funktioniert nun unter Windows, Mac und Linux (Gnome-Tray und KDE-Tray) +- [Maj0r] CPU-Last der Suchergebnisdarstellung wesentlich verringert. + Nun sind auch große Treffermengen gut verwendbar (Test mit 1500 bis 2000 Treffern pro Suche bei 3 Suchen). + Lediglich das initiale Laden der Treffer dauert etwas, das Zeug muss halt über die Leitung und einmal geparst werden. +- [Maj0r] Anzahl aller unterschiedlichen gefundenen Dateien einer Suche wird im Suchergebnisreiter angezeigt +- [Maj0r] Ist beim Start Loglevel Debug eingestellt, wird ein weiterer Reiter "Debug" angezeigt, der alle Lognachrichten enthält +- [Maj0r] Featurerequest: Gesamtpunkte der gesetzten Priorität wird im Sharebereich ( x/1000 ) angezeigt. (Danke an `fdh`) +- [Maj0r] TKLControls eingebaut ([www.tkl-soft.de](http://www.tkl-soft.de)) + In den Optionen und im Wizard werden nun Felder mit modifizierten Werten blau umrahmt. Mit `Strg+z` kann der Ursprungswert wieder hergestellt werden. + Ungültige Werte werden rot umrahmt (z.B. im Downloadlinkfeld im Downloadbereich). +- [Maj0r] Bug #527 gefixt: 100%-CPU-Bug behoben. Trat immer auf, wenn man die Größe der Partliste veränderte. (Danke an `fdh`) +- [Maj0r] Featurerequest #476: Suchergebnisse, die bereits im Temp oder im Share vorhanden sind, werden grün markiert. (Danke an `clickweg`) +- [Maj0r] GUI komplett refactored und auf die neue `CoreFassade 1.0` umgebaut +- [loevenwong] Featurerequest #549 Automatischen Powerdownload komplett überarbeitet. (Danke an `xxluckystrikexx`) + +**0.61.2** + +- [Maj0r] Bug #528 gefixt: Deadlock bei der Darstellung der Partliste behoben. (Danke an `akku`) +- [Maj0r] Bug #525 gefixt: Das GUI nutzte bei ungünstiger Datenkonstellation 100% CPU-Zeit (Danke an `akku` und `apokalypse1982`) + +**0.61.1** + +- [Maj0r] Auf vielfachen Wunsch Partlistanzeige wieder auf mehrere Threads aufgeteilt. Braucht wieder etwas mehr Ressourcen, ist aber beim gefühlten Laden schneller. +- [Maj0r] Bug #524 gefixt (Danke an `akku` und `fdh`) +- [Maj0r] Bug gefixt: Nach Benutzung von "Priorität löschen" wurde die View nicht aktualisiert. + +**0.61.0** + +Core ab Version **0.30.146.1202** wird benötigt + +- [Maj0r] Wenn ein Download hinzugefügt wird, gibt es nun, wenn der Core einen Fehler meldet, eine Benachrichtigung. +- [Maj0r] Bug gefixt (Danke an Up) + Coreseitig beendete Suchen werden nun auch im GUI als beendet dargestellt. +- [Maj0r] `skinlf.jar` aktualisiert +- [Maj0r] ajl-Listen können nun direkt mit Angabe eines Zielverzeichnisses importiert werden +- [Maj0r] Downloads können nun direkt mit Angabe eines Zielverzeichnisses gestartet werden +- [Maj0r] Anzeige zusätzlicher Information gesharter Dateien (Datum letzter Anfrage, Anzahl Downloadanfragen, Anzahl Suchanfragen) +- [Maj0r] Bug gefixt + Es konnte mit jedem offenen Port eine Verbindung hergestellt werden, das GUI blieb anschließend leer. + Unterscheidung zwischen ungültiger Coreadresse und falschem Passwort eingebaut. +- [Maj0r] Featurerequest #465 (Danke an clickweg) + Beim ersten Start des GUIs wird versucht, anhand der Standardeinstellungen zu verbinden. +- [Maj0r] Die Datei properties.xml wurde durch die Datei ajgui.properties ersetzt. +- [Maj0r] Einschränkung aufgehoben + Im Verbindungsdialog können nun beliebig viele Cores gespeichert werden. +- [Maj0r] Bug #490 gefixt (Danke an Up) + Umlaute sind nun in Verzeichnis- und Dateinamen in den Optionen möglich. +- [Maj0r] Bug gefixt + Im Verbindungsdialog funktionierte die Datenübernahme nicht, wenn im Host- oder Passwortfeld Return betätigt wurde. +- [Maj0r] Featurerequest #475 (Danke an clickweg) + Anzeige der Verfügbarkeit in Prozent der aktuell gezeigten Partliste. +- [Maj0r] Featurerequest #481 (Danke an johannes8) + Firewall-Warnung wird nun zusätzlich als Symbol und als Tooltipp ganz links in der Statusleiste angezeigt. +- [Maj0r] Bug #494 gefixt (Danke an dsp2004) +- [Maj0r] Bug #505 gefixt (Danke an rexcorda) +- [loevenwong] Focus wird auf das Passwort-Feld gesetzt. + +**0.60.0** + +- [Maj0r] Featurerequest #472 (Danke an clickweg) + Downloads, Shares und Suchergebnisse werden nun mit passenden Icons dargestellt (vgl. Suche). +- [loevenwong] Featurerequest #458; Verbindungswizard kann über Optionen->Verbindungen gestartet werden.- [loevenwong] Featurerequest #414 (Danke an clickweg) + Download-Tooltipps können per Optionen->Ansicht deaktiviert werden. +- [loevenwong] Wenn automatisch Verbinden ausgewählt ist, wird anschliessend noch geprüft, ob die SHIFT-Taste gedrückt wird (nach Erscheinen des Splash-Screens), + falls doch ein anderer Core verwendet werden soll.- [loevenwong] Tastaturereignisse beim Anmeldedialog um ENTER/ESCAPE erweitert.- [Maj0r] Featurerequest + Unter Optionen->Ansicht kann ein Programm ausgewählt werden (z.B. VLC). + Wenn der Core auf dem gleichen Rechner wie das GUI läuft, dann wird in der Downloadtabelle und in der Sharetabelle im Kontextmenü ein neuer Menüpunkt aktiviert. + Mit diesem wird der Shareeintrag an das verknüpfte Programm übergeben. +- [Maj0r] Bug #175 gefixt (Danke an jr17) + TrayIcon gefixt. +- [Maj0r] Bug #413 gefixt (Danke an hirsch.marcel) + Leere Suchen werden nicht mehr ausgeführt. Leerstellen am Anfang und am Ende eines Suchbegriffs werden entfernt. +- [Maj0r] Featurerequest #442 (Danke an clickweg) + Uploads können nun per Kontextmenü als Links in die Zwischenablage kopiert werden. +- [Maj0r] Stats eingebaut. Parameter: -command=getajstats +- [loevenwong] Versionsanzeige eingebaut. Parameter: -command=getajinfo + +**0.59.3** + +- [Maj0r] Bugfix (Danke an muhviehstarr) + Zwei Deadlocks behoben. Einer bewirkte, dass das GUI beim Start beim Splashscreen hängen bleiben konnte. +- [Maj0r] \n in der Servernachricht wird nicht mehr beachtet. Html-Tags verwenden. +- [Maj0r] Featurerequest + Automatischer Powerdownload pausiert nun standardmäßig nicht mehr die Downloads. + Außerdem kann nun ein Einstellungendialog implementiert werden, um Anpassungen während des Betriebs des autom. Pwdls vorzunehmen. +- [Maj0r] Bugfix + Bei sehr hohen Maxupload- und/oder Maxdownloadwerten kam es zu Fehlern im TrayIcon. +- [Maj0r] Bug #421 gefixt (Danke an Up) + Wizard wurde um Standardeinstellungen für DSL 1000, DSL 2000 und DSL 3000 erweitert. +- [Maj0r] Bug #423 gefixt (Danke an hirsch.marcel und Up) + Aktive, indirekte Uploads werden wieder angezeigt. +- [Maj0r] Dreckigen Rest im Uploadbereich entfernt. + +**0.59.2** + +- [Maj0r] Bug #420 gefixt (Danke an Up) + Ganz frischen NullPointer gefixt. + +**0.59.1** + +Core ab Version **0.30.145.610** wird benötigt + +- [Maj0r] Wasserstände der einzelnen Uploader werden angezeigt. +- [Maj0r] Beim Serverwechsel wird nun eine qualifizierte Warnung ausgegeben, wenn die aktuelle Verbindung noch keine 30 Minuten besteht. +- [Maj0r] Bugfix + Beim Neuerzeigen der properties.xml wurden die neuen Coredaten nicht für die aktuelle Sitzung übernommen. + Folge war ein Verbindungsverlust. + +**0.59.0** + +- [Maj0r] Durch Ändern einer Source-Variable in der AutomaticPowerdownloadPolicy.java kann das Pausieren von Dateien verhindert werden. +- [Maj0r] Bug #392 gefixt (Danke an Up und jr17) + Im Zuge der XML-Parser-Umstellung (0.56.1) ist die Firewallwarnung verschütt gegangen. +- [Maj0r] Icons für Uploads in der Warteschlange korrigiert. +- [Maj0r] Downloadadresse für die Updateinfodatei auf Wunsch der berlios-Crew von berlios.de auf tkl-soft.de geändert. +- [Maj0r] Uploads, die zwar in der Warteschlange sind, aber keine aktive Verbindung halten, werden jetzt im dreckigen Rest angezeigt. + +**0.58.0** + +Core ab Version **0.30.144.522** wird benötigt + +- [Maj0r] Bug #360 gefixt (Danke an fapu & panterfrau) + Beim Linkklicken konnte es passieren, dass zwei GUIs gestartet werden. +- [Maj0r] Bug #361 gefixt (Danke an panterfrau) + Logfehlermeldung bei überlastetem Core wird nun nur noch als Debug gelogt. +- [Maj0r] Featurerequest (Danke an Up) + Bei Servern ohne Namen wird nun im Startbereich IP:Port angezeigt. +- [Maj0r] Willkommensnachricht des Servers eingebaut. +- [Maj0r] Anzeige, ob die Warteschlange voll ist, im Uploadbereich eingebaut. +- [maj0r] In der Statusspalte eines nicht aktiven Uploads wird nun die Corezeit der letzen Aktivität angezeigt. + +**0.57.1** + +- [Maj0r] Bugfix (Danke an mich ;) ) + Beim Laden von Plugins konnten Fehler beim Classloading auftreten. Wenn der Statusbalken bei "Lade Plugins..." hängen bleibt, bitte updaten. +- [Maj0r] Change (Danke an hirsch.marcel) + Irc-Server im Infodialog angepasst. +- [Maj0r] Archivdifferenzierung beseitigt (Besonderen Dank an Up für die Windows-Starter-Exe !!) + Es gibt fortan keine separaten Archive mehr für Windows und andere Betriebssysteme. +- [Maj0r] Featurerequest #319 (Danke an tom62) + Sortierung im Dateilistenexport eingebaut. +- [Maj0r] Bugfix (Danke an muhviehstarr) + Sortierung nach Zeit in der Serveranzeige korrigiert. +- [Maj0r] Bug #322 gefixt (Danke an torsten_altreiter) + Der Dateiname wurde per Linkübernahme aus der Suche nicht korrekt übernommen. +- [loevenwong] Updateprüfung auch per Menüeintrag ermöglicht. +- [Maj0r] Standardaussehen auf JGoodies geändert (weniger ressourcenlastig) + Themes können natürlich weiterhin verwendet werden. + +**0.57.0** + +- [Maj0r] Bugfix (Danke an whitewindow) + Die Anzahl der Quellen pro gefundener Datei wurde bei neuen Ergebnissen nicht korrigiert. + Die Anzahl der gefundenen Dateien war korrekt, jedoch die Anzahl der Quellen pro Datei entsprechend niedrig. +- [Maj0r] Bug #306 gefixt (Danke an dsp2004) + Bei Partlistanfragen an einen überlasteten Core kam es zu Fehlern. +- [Maj0r] Fortschrittsbalken in den Splashscreen eingebaut. +- [Maj0r] Tooltipps in der ersten Spalte der Downloadtabelle eingebaut. +- [Maj0r] Info-Dialog geändert + Credits geändert. + Credits lassen sich nun per Mausklick in den Dialog anhalten bzw. fortsetzen. + +**0.56.2** + +- [Maj0r] Bug #293 gefixt (Danke an dsp2004) + Bei Partlistanfragen an einen überlasteten Core kam es zu Fehlern. +- [Maj0r] Bug #260 gefixt (Danke an computer.ist.org) + Buttons im Sharebereich dürfen erst aktiviert werden, wenn die Einstellungen vom Core geholt wurden. +- [Maj0r] Bug #282 gefixt (Danke an tnt23) + NullPointer behoben, der auftrat, wenn man im Sharebereich auf "Prioritaet setzen" geklickt hat, ohne vorher einen Eintrag zu selektieren. +- [Maj0r] Bug #273 gefixt + Es kam zu einem Fehler, wenn die Partliste nicht den gesamten reservierten Bereich bedeckte und dieser Teil von der Maus überwandert wurde. +- [loevenwong] Featurerequest #222: Combobox zur Auswahl der letzten 3 Verbindungen eingebaut. (Danke an `hirsch.marcel`) +- [Maj0r] Featurerequest #222 (Danke an `johannes8`) + Download-Umbennen-Dialog bietet nun eine Auswahl der gefundenen Namen der Sourcen des Downloads an. +- [Maj0r] Kontextmenü im Downloadbereich überarbeitet + F-Tasten eingebaut. + Pausieren und Fortsetzen auf vielfachen Wunsch getrennt. +- [Maj0r] Dialog zur Eingabe eines Datei-Incoming-Verzeichnisses kann jetzt per `RETURN` bestätigt werden. +- [Maj0r] Bug behoben, der sich durch die dynamische Generierung der properties.xml ohne Neustart eingeschlichen hat. +- [loevenwong] Einfügen per Kontextmenü im Download-Textfeld eingebaut. +- [loevenwong] Einstellungen der JGoodies werden jetzt gespeichert. +- [Maj0r] Installierte Look&Feels werden beim Generieren der Standard-XML mit aufgenommen. + +**0.56.1** + +diese Version benötigt den Core ab Version **0.29.135.208** + +- [Maj0r] GUI startet nur noch bei unterstützter Coreversion +- [loevenwong] GUI muss nicht neugestartet werden, wenn noch kein Property-File vorhanden ist (wird weiterhin automatisch erzeugt). +- [Maj0r] Featurerequest #254 gefixt (Danke an te_real_ZeroBANG) + Downloadtabelle wird jetzt beim Start standarmäßig nach Dateiname sortiert. +- [Maj0r] Featurerequest #274 gefixt (Danke an johannes8) + Downloads können per F2 umbenannt werden. +- [Maj0r] Bug #264 gefixt (Danke an muhviestarr) + Verbindungsstatus wird richtig angezeigt. +- [Maj0r] Modifizierbare und potenziell modifizierbare Dateien bei Nicht-Windows-System verschoben + properties.xml nach ~/appleJuice/gui + Plugins nach ~/appleJuice/gui/plugins + Logs nach ~/appleJuice/gui/logs +- [Maj0r] Pluginschnittstelle komplett überarbeitet + Alle vorhandenen Plugins müssen an die neue Schnittstelle angepasst werden. + Gründe für die Überarbeitung: + 1\. einfacher + 2\. Eingrenzung der Plugins und Minimierung der Fehlermöglichkeiten + 3\. Sprachdateien werden unterstützt (zB language_xml_deutsch.xml im Plugin-Jar) +- [Maj0r] Suchergebnisse werden nun, wenn möglich mit einem sprechenden Icon angezeigt. +- [Maj0r] Suche um Filter erweitert + Die Filter in der Suchergebnistabelle wirken sich NICHT auf die Suche aus, lediglich die Treffer werden gefiltert. +- [Maj0r] Status "Warteschlange voll" wird nun auch in "In Warteschlange" angezeigt, da diese zB für Pwdl-Änderungen genauso relevant sind. +- [Maj0r] TableHeader werden in allen Tabellen gleich dargestellt. +- [Maj0r] Unterstützung für fremde Look&Feels eingebaut + Um Look&Feels zu verwenden, müssen die Themes deaktiviert werden. + Ausgeliefert werden nur JGoodies als alternative Look&Feels. + Es können alle konformen Look&Feels verwendet werden. Dazu einfach ein passendes Jar in /needed_jars legen und die Look&Feel-Klasse in der propertes.xml eintragen. +- [Maj0r] Unnützes Passwortfeld unter Optionen->Passwort entfernt. +- [Maj0r] Passwortfeld unter Optionen->Proxy ist nun wirklich ein Passwortfeld und stellt das Passwort nicht mehr im Klartext dar. +- [Maj0r] Standardthemepack auf Toxic geändert. + +**0.56.0** + +meine wahrscheinlich letzte GUI für den Core 0.29.x +**- Soundausgabe bei korrektem Login korrigiert. +- Sound bei fertigem Download eingebaut. +- Unicode-Verwendung im Umgang mit den Sprachdateien korrigiert. +- Kleinere Korrekturen. + +**0.55.10** + +- Bug #246 gefixt: Nun können auch bei "voller" Dateilistetabelle im Sharebereich neue Dateien hinein gezogen werden. (Danke an `mail_tom62`) +- Automatische Sortierung nach Dateiname eingebaut. +- Featurerequest #244 gefixt: Standardmäßig ist nun beim automatischen Powerdownload der Inaktiv-Button selektiert. (Danke an `Homer1Simpson`) +- Bug #243 gefixt: GUI stört sich nicht mehr an Nicht-Themes-Zips im Themes-Verzeichnis. (Danke an `RoadRunner`) +- Bug #241 gefixt: Farbgebung war genau umgekehrt. Nun gilt wirklich: je dunkler, desto mehr Quellen gefunden. (Danke an `computer.ist.org`) +- Partliste zeigt nun per MausOver-Effekt den Tooltipp zum ausgewählten Partstück an. + +**0.55.9** + +- Link zur FAQ im Startbereich hinzugefügt. +- Bug #242 gefixt: Legende für Partliste um "aktive Übertragung" erweitert. (Danke an `Kossi-Jaki`) +- Bug behoben, der im VersionChecker zu einer NoSuchElementException führte. (Danke an `computer.ist.org`) +- Bug #239 gefixt: ArrayIndexOutOfBoundsException behoben. (Danke an `dsp2004`) +- Bug #235 gefixt: Passwortfeld im Logindialog funktioniert wieder ordentlich. (Danke an `Up`) + +**0.55.8** + +- Bug #234 gefixt: Tabellen werden beim Ändern von Spaltengrößen nicht mehr sortiert. (Danke an `hirsch.marcel`) +- Featurerequest #228: Im Pwdl-Eingabefeld funktionieren nun auch die Hoch/Runter-Pfeiltasten. (Danke an `Major-Tom`) +- Links werden nun bei Übernahme in eine verwertbare Schreibweise geparst. +- Bug #226 gefixt (Danke an dsp2004) +- GUI reagiert ordentlich auf eine coreseitige Passwortänderung. +- Server werden nun korrekt angezeigt. +- weitere Speicheroptimierung. + +**0.55.7** + +- Bug #223 und #224 gefixt: Das waren noch Bugs in Verbindung mit der DOM/SAX-Umstellung... (Danke an `dsp2004`, `Up` und `whitewindow`) + +**0.55.6** + +- meisten Teile von DOM auf SAX umgebaut, RAM-Verbrauch sollte dadurch spürbar gesenkt werden. +- Bug #219 gefixt: 100%-CPU bei Eingabe eines falschen Passwortes beim Anmeldedialog gefixt. (Danke an `Up`) +- Bug #220 gefixt: OutOfMemoryError behoben. (Danke an `dsp2004`) + +**0.55.5** + +- alten Timestampfehler beseitigt. Trotz Sessionumsetzung wurde immer noch der Timestamp mitgeschleppt. +- Bug #215 gefixt: Partliste wird nun auch bei kleinen Dateien korrekt gezeichnet. (Danke an `dsp2004`) +- Bug #129 gefixt: WebsiteException durch Überlastung des Cores sollte nun weitgehend unterbunden sein. (Danke an dsp2004) + +**0.55.4** + +- Bug #23 gefixt: Suche abbrechen korrigiert. (Danke an `computer.ist.org`) + +**0.55.3** + +- Mehr Logging für WebSiteNotFoundException eingebaut. +- Partliste bearbeitet: + Hoffentlich den letzten Fehler behoben. + Anzeige der Teile, die zurzeit übertragen werden (hellgelb bis dunkelgelb). + Aktualisierungintervall auf 2 Sekunden geändert. +- Button zum Verwerfen einer abgebrochenen Suche in den Suchreiter verschoben. +- Link mit Quellen kann nun auch im Sharebereich erzeugt werden. +- Bug #195 gefixt: Bug bei Pwdl-Einstellung korrigiert.. (Danke an `supermuhkuh`) +- Bug #167 gefixt: Sortierung nach Anzahl in der Suchtabelle korrigiert. (Danke an `arnoldfake`) +- Bug #198 gefixt: Sortierung nach Downloadstatus korrigiert. (Danke an `froeschle567`) + +**0.55.2** + +Core ab **0.29.135.208** ist zu verwenden. + +- Max. Anzahl von Quellen pro Datei kann nun begrenzt werden +- SplitPane in Sharebereich eingebaut. +- Sortierung des Sharebaums verbessert. +- Sortierung in Incoming- / Tempauswahlbaum eingebaut. +- Partliste überarbeitet. +- Startbereich scrollbar gemacht, wenn die Darstellung zu klein ist. +- Rand der JSplitPane im Downloadbereich entfernt (Danke an `muhviestarr`). +- Icons für Upload-DirectStates eingebaut. +- verwendete Java-Version wird in die Logdatei geschrieben. +- Wizarddialog korrigiert: Nickname wird nun auf Richtigkeit geprüft und gespeichert wird erst nach Durchlaufen des gesamten Wizards. +- Bug #94 gefixt: Zulässige Werte für Core-Port und XML-Port sind 1024<x<=32000. (Danke an `error666`) +- Bug #185 gefixt: Einstellungen des GUIs werden beim Schliessen des Core gesichert. (Danke an `muhviestarr`) +- Downloadlinks können optional mit der eigenen Quelle und ggf. mit dem verbundenen Server in die Ablage kopiert werden. +- Serverlinks können in die Ablage kopiert werden. + +**0.55.1** + +Core ab Version 0.29.133.201 ist zu verwenden. + +- Kommunikation mit dem Core erfolgt nun komprimiert + +**0.54.7** +- AutomaticPowerdownloadPolicies können nun von Benutzern mit Java-Erfahrung selbst implementiert werden + Dazu muss die Klasse AutomaticPowerdownloadPolicy abgeleitet und ein Jar gebaut werden. + Zum Bauen des jar-Archivs gibt es ein neues Target in der build.xml. + Das GUI erwartet diese Jars im Unterordner /pwdlpolicies. +- "Verbindung zum Core verloren" sollte nicht mehr so schnell kommen (Danke an `the_Killerbee`). +- Interne Umbauten um Objekte zu sparen + Alle Plugins, die auf globale Objekte mittels MapSetStringKey zugreifen, müssen angepasst werden, sind in ihrer alten Version nicht mehr lauffähig und führen zu ClassNotFoundExceptions im Log. + Anstatt eines "new MapSetStringKey(String)" reicht nun dieser String oder ein "Integer.toString(int)" bei IDs. + Die Klasse MapSetStringKey wurde restlos entfernt. +- Logging verbessert + main() in eigene ThreadGroup gepackt, dadurch kann keine Exception mehr "durchrasseln", alle Exceptions finden sich im Log. + +**0.54.6** + +Nur Frische Bugs beseitigt + +- Bug #155 gefixt (Danke an daa803) + Sharebaum wird nun wieder korrekt dargestellt. +- Bug #154 gefixt (Danke an hirsch.marcel) + Alte Objekte werden jetzt wieder korrekt entfernt. +- Bug #160 gefixt (Danke an octron80) + Fertige oder abgebrochene Downloads können nun wieder entfernt werden. +- Bug #153 umgesetzt (Danke an jr17) + Verbindungsdialog kann nun per Option beim nächsten GUI-Start erzwungen werden. + +**0.54.5** + +- Filter beim Start des GUI eingebaut + Die Quellen werden beim ersten Holen der Daten vom Core nicht abgefragt, so dass Downloads sehr schnell gezeigt werden können. + Nachteil: Da die Quellen anfangs fehlen, stehen die Geschwindigkeiten aller Downloads auf 0 kb/s. Die Gesamtgeschwindigkeit wird jedoch angezeigt. + Das lange Laden aufgrund von vielen Quellen wird so folglich nur verschoben und der Benutzer bekommt früh erste Informationen zu sehen. +- Icons für Netware und OS/2 eingefügt. +- Wiederholtes, zeitintensives Laden der gesamten Infos sollte nun durch ein überarbeitetes Sessionmanagement unterbunden sein. +- Fehlerhafte Anzeige von Menütexten bei Nicht-Windows-Systemen gefixt. + +**0.54.4** + +- Kontextmenüs mit Icons ausgestattet. +- Optionenmenü überarbeitet. +- An neue Coreschnittstelle angepasst. +- TrayIcon-Bug hoffentlich behoben. + +**0.54.3** + +- Reihenfolge der Spalten der Download- und Uploadtabelle wird gespeichert + Da die properties.xml angefasst werden musste, wird diese beim ersten Start neu generiert. +- Bug #74 gefixt (Danke an habkeineMail) +- ajl-Listen können nun über das Menü importiert werden. +- Sprachdatei "türkisch" eingebaut (Danke an nurseppel). +- Upload-Fortschrittsanzeige wird jetzt nur noch bei aktiven Uploads angezeigt. +- Laden von Plugins verbessert. + Müll oder nicht standardkonforme Plugins im Plugin-Ordner werden nun korrekt behandelt. +- Bug #98 gefixt (Danke an twix) + +**0.54.2** + +- Bug #91 umgesetzt (Danke an hirsch.marcel) + Maxupload- und Maxdownloadgeschwindigkeit kann nun über das TrayIcon eingestellt werden (Windowsversion). +- Bug #82 gefixt (Danke an hirsch.marcel) + Sortierung von Downloads innerhalb von Unterverzeichnissen der Downloadtabelle korrigiert. +- Sortierung in die Suchergebnistabelle eingebaut. +- Bug #92 gefixt (Danke an daa803) +- Bug #77 gefixt (Danke an spam_blocker) + Selektionsproblem der Downloadtabelle beim Entfernen von fertigen Downloads behoben. +- Tabellenspalten der Download- und Uploadtabelle können nun über ein Kontextmenü bei Rechtsklick auf den Tabellenheader aus/eingeblendet werden. +- Im Downloadbereich sind nun der obere (Tabelle) und der untere Bereich (Powerdownload, Partliste) in der Höhe verstellbar. +- Bug #83 gefixt (Danke an hirsch.marcel) + Tabellenspalten können nun korrekt verschoben werden.. +- Bug #33 gefixt (Danke an oz_2k) + Obwohl ich denke, dass es sich um ein Feature der Themes handelt, wurde der Vollbildmodus auf Wunsch vieler Benutzer an Windowsstandard angepasst. + +**0.54.1** + +- Bug #53 gefixt (Danke an o_a_s_e_) + 98%-CPU-Last Bug durch Suche gefixt. +- Warnmeldung bezüglich 30-Minuten-Sperre bei manuellem Serverwechsel eingebaut. +- Bug #63 umgesetzt (Danke an clickweg) + Den Link zum Holen von Servern in einen Button umgebaut, da der Link wohl von vielen übersehen wurde. +- Bug #23 gefixt (Danke an computer.ist.org) + Suche lässt sich nun korrekt abrechen. + +**0.53.2** + +- Bug #67 gefixt (Danke an dsp2004) + Probleme mit der Funktion automatisch Partliste anzeigen korrigiert. + +**0.53.1** + +- Wenn die Verbindung zum Core aufgrund von Überlastung des Core abreisst, wird 2x erneut probiert, bevor das GUI beendet wird. +- TrayIcon für Windowsplattformen eingebaut +- Bug #56 gefixt (Danke an MeineR) + Das Laden der Plugins beim Start kann über das Optionenmenü deaktiviert werden. +- Bug #43 gefixt (Danke an flabeg) + Shareverzeichnis wird bei Prioritätenänderung nicht mehr komplett neu geladen, sondern nur aktualsiert. +- Bug #13 umgesetzt (Danke an HabkeineMail) + Powerdownload-Werte werden jetzt bei Klick auf einen Download / Quelle im Powerdownloadfeld angezeigt. +- Bug #42 umgesetzt (Danke an dsp2004) + Partlisten werden nun durch eine Option wahlweise bei Mausklick auf den Download / Quelle oder über den Button "Partliste anzeigen" geholt. +- properties.xml aus den Download-Archiven entfernt + Beim Update auf eine neuere Version muss diese nun nur noch bei einer Formatänderung erneuert werden. + Nachteil: Bei einer kompletten Neuinstallation erhält man beim ersten Start eine Fehlermeldung und muss das GUI neu starten. +- Wenn eine neue Version gefunden wird, kann diese nun direkt mit dem Standardbrowser herunter geladen werden + Der Standardbrowser muss in den Optionen ausgewählt werden. +- Links im Startbereich sind jetzt anklickbar, sofern ein Standardbrowser ausgewählt ist. +- Bug #40 umgesetzt (Danke an hirsch.marcel) + Incoming-Verzeichnis kann nun für mehrere Downloads gleichzeitig geändert werden. +- PluginOptionenDialog überarbeitet. +- Dialog bei fehlgeschlagenem Verbindungsversuch überarbeitet. +- Menüpunkt zum Beenden des Core auf vielfachen Wunsch an separate Stelle verschoben. +- Bug #17 gefixt (Danke an HabkeineMail) + Partlisten von einigen wenigen DownloadSourcen wurden bei Bedarf nicht geholt. +- sonstige Kleinigkeiten. + +**0.52.1** + +- Plugin-Entwickler können nun ein JPanel für Optionen implementieren, welches ggf. im Plugin-Reiter der Optionen aufgerufen werden kann.. +- Plugin-Entwickler können nun Objekte direkt mittels ID vom Core erfragen (Danke an webhamster). +- Bug #19 gefixt (Danke an dsp2004) + Nullpointer behoben. + +**0.51.2** + +- Bug #14 umgesetzt (Danke an Dragonne) + Es konnte zu einem Fehler kommen, wenn gleichzeitig zwei Instanzen des GUIs liefen. +- Der Core kann jetzt übers GUI beendet werden. +- Downloads können nun umbenannt werden. +- Das Zielverzeichnis für einen Download (Incoming-Unterverzeichnis) kann nun geändert werden. +- Überprüfung auf gültige Javaversion eingebaut + Es wird mindestens 1.4 benötigt (empfohlen 1.4.2). +- Suchanzeige korrigiert + Es kann passieren, dass nicht alle gefundenen Suchergebnisse beim Core ankommen, die Ausgabe wurde entsprechend korrigiert. +- Bug #8 umgesetzt (Danke an finn) + Downloadlinks kann man nun auch direkt in der Downloadtabelle per Kontexmenü erzeugen. + Ich wollte es eigentlich nicht umsetzen, da ich die Funktion an dieser Stelle für falsch platziert erachte, doch da der Wunsch bei vielen Benutzern bestand, hab ich es nun doch eingebaut. + In die Uploadtabelle werde ich es definitiv NICHT einbauen. +- Bug #10 fixed (Danke an muhviestarr) + Wenn man keine Downloads hat, steht nun nicht mehr "bitte warten" in der Downloadtabelle. + +**0.51.1** + +- Downloadlinks werden jetzt in ISO-8859-1 an den Core übertragen. +- Versionupdateinformation geändert + Über die Optionen kann nun gewählt werden, ob man nur bei neuen Versionen (0.51.1), wichtigen Änderungen (0.51.1) oder sogar bei kosmetischen Korrekturen (0.51.1) benachrichtigt wird. + Standard ist Benachrichtigung bei wichtigen Änderungen. +- Bug #1 fixed (Danke an muhviestarr) + Look & Feel stimmt nun auch beim Verbindungsdialog. +- Bug #2 fixed (Danke an muhviestarr) + Taskbareintrag für den Splashscreen und den Verbindungsdialog eingebaut. +- Bug #4 fixed (Danke an muhviestarr) + Shareanzeige bei Prioritaetenaenderung gefixt. +- Dateigrößen in der Sharetabelle werden nun korrekt ausgegeben (Danke an schnigger und TuxHomer). +- Nullpointer behoben der auftrat, wenn der verbundene Server keinen Namen hat (Danke an paderborner). + +**0.50** + +- Logging kann nun komplett deaktiviert werden (Danke an muhviestarr). +- Im Verbindungsfenster geht nun ein einfaches <Enter> (Danke an muhviestarr). +- Legende für die Servertabelle eingebaut (Danke an muhviestarr). +- Text von Netzwerk, Neuigkeiten und Nachrichten ist nun auch schwarz (Danke an muhviestarr). +- Die Überschrift "Warnungen" auf der Startseite wird nun ausgeblendet, wenn es keine Warnungen gibt (Danke an muhviestarr). +- Gridlines werden nun in der Servertabelle nicht mehr angezeigt (Danke an muhviestarr). +- Splashscreen wird nun früher angezeigt (Danke an muhviestarr). +- Bug in der Partliste behoben. +- Dau-Button zum Anzeigen der Partliste eingebaut. +- Bug der Tableheader der Share- und der Uploadtabelle behoben (Danke an muhviestarr). + +**0.49** + +- Bug bei der Wiedergabe von Sounds korrigiert (Danke an mrbond). + Sounddevice wird nun nach Ausgabe eines Sounds wieder freigegeben. +- Es kann nun der Link einer gesharten Datei über das Popupmenü der Sharetabelle als UBB-Code in die Ablage kopiert werden. +- Entwicklercreditsanzeige im Infodialog korrigiert. +- Bug im Sharebaum behoben. +- Bug beim Sortieren der Sharetabelle behoben. + +**0.48** + +- Initialen Aufruf des Sharetabs durch einen Initialisierungsthread beschleunigt. +- In der Downloadtabelle nun ein Warteicon angezeigt, bis erstmalig Daten geholt wurden. +- Verhalten des Popupmenüs der Servertabelle überarbeitet. +- Partliste wird nun nur noch über das PopupMenü geholt. + Wenn der Downloadtab verlassen wird, wird das Aktualisieren der aktuellen Partliste beendet. + +**0.47** + +- Sharetabelle auf vielfachen Wunsch komplett überarbeitet. +- Partliste wird erst nach 2 Sekunden Wartezeit geholt (Danke an muhviestarr). + Wenn innerhalb dieser Zeit auf einen anderen Download.bzw. eine andere Quelle geklickt wird, wird die Wartezeit neu gestartet. +- Suche kann nun GUI-seitig abgebrochen werden. + Der aktuelle Core (0.29.124.1215) hat an dieser Stelle noch einen Bug, eine Suche wird jedoch nach einiger Zeit automatisch beendet. +- Tabellenspaltenroothandles werden nun in der Downloadtabelle angezeigt (Danke an muhviestarr). + So weiss auch der letzte Benutzer, dass man auf einen Download klicken kann, um die Quellen zu finden. +- Neuen Downloadstatus "Fehler beim Fertigstellen" und neuen Quellenstatus "Eigenes Limit erreicht" eingebaut. +- Rundungsfehler beim automatischen Powerdownload behoben (Danke an garnichda). + +**0.46** + +- Bug beim autom. Pwdl behoben, der auftrat, wenn nur eine Datei im Download war. +- Bug im Menü behoben, Auswahl eines Menüpunktes geht nun gewohnt schnell.. +- Kleinere optische Korrekturen (Danke an DBZfan) + z.B. Hintergrundfarben aller Scrollbereiche an ihre Tabelle angepasst. +- Prozentangabe bei Downloads nun auf zwei Nachkommastellen genau (Danke an muhviestarr) +- Parameterübergabe an das GUI geändert + Mögliche Parameter können per -help angezeigt werden. + Die reg-Datei muss neu angepasst und importiert werden, da diese ebenfalls modifiziert werden musste. +- diverse andere Bugs behoben + +**0.45** + +- Links können nun an das GUI übermittelt werden (für den INet-Explorer muss die entsprechende reg-Datei angepasst und importiert und die Windows-Exe verwendet werden). +- Themes sind nun deaktivierbar + +**0.44** + +- Themes eingebaut (Danke an `LinuxDoc`) + Passende Themes gibt?s auf https://github.com/l2fprod/javootoo.com/tree/master/plaf/skinlf/themepacks. +- Automatischen Powerdownload eingebaut. + Verschiedene Arten des autom. Pwdls können in Zukunft durch selbst implementierte Klassen per Combobox ausgewählt werden (nächste Version). + +**0.43** + +- max.RAM-Anzeige in Memory-Monitor eingebaut (Anzeige oben links nun "reserviert / max allocated"). +- Soundicons optisch korrigiert. +- Fehler bei der Soundausgabe bei fehlerhaften Sounddateien (z.B. falsches Format) oder fehlendem Sounddevice behoben. + +**0.42** + +- Memory-Monitor eingebaut (ja, die Anzeige geht richtig und zeigt den echten RAM-Verbrauch der Anwendung) +- manuellen GarbageCollector bei jeder 30\ +- Aktualisierung eingebaut + +**0.41** + +- Fehler im Pwdl-Textfeld behoben +- Sortieren der Downloadtabelle nach Status eingefügt +- Speicheroptimierungen. + +**0.40** + +- Soundeffekte für diverse Ereignisse eingefügt. + +**0.39** + +- Standarduploadpriorität ist im Core noch nicht implementiert und deshalb erstmal wieder aus dem GUI geflogen (Danke an `xcalibur`) +- Buttons zum Ändern der Pwdl-Werte entsprechend dem Standard vertauscht (Danke an `lova`) +- Baum zur Auswahl des Temp- und Incomingordners korrigiert. Bug hat sich erst mit `v0.38` eingeschlichen (Danke an `lova` und `akku`) diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..0daa0415 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,336 @@ +GNU General Public License +========================== + +_Version 2, June 1991_ +_Copyright © 1989, 1991 Free Software Foundation, Inc.,_ +_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +### Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: **(1)** copyright the software, and +**(2)** offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +**0.** This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The “Program”, below, +refers to any such program or work, and a “work based on the Program” +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term “modification”.) Each licensee is addressed as “you”. + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +**1.** You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +**2.** You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +* **a)** You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. +* **b)** You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. +* **c)** If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +**3.** You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +* **a)** Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, +* **b)** Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, +* **c)** Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +**4.** You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +**5.** You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +**6.** Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +**7.** If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +**8.** If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +**9.** The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and “any +later version”, you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +**10.** If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +### NO WARRANTY + +**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w` and `show c` should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w` and `show c`; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a “copyright disclaimer” for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/ProcessNoST/.classpath b/ProcessNoST/.classpath deleted file mode 100644 index 39a54068..00000000 --- a/ProcessNoST/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="lib/pride.jar"/> - <classpathentry kind="lib" path="lib/junit.jar"/> - <classpathentry kind="lib" path="lib/mm.mysql-2.0.14-bin.jar"/> - <classpathentry kind="output" path="classes"/> -</classpath> diff --git a/ProcessNoST/.project b/ProcessNoST/.project deleted file mode 100644 index 02d88992..00000000 --- a/ProcessNoST/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>ProcessNoST</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/ProcessNoST/lib/junit.jar b/ProcessNoST/lib/junit.jar deleted file mode 100644 index 674d71e8..00000000 Binary files a/ProcessNoST/lib/junit.jar and /dev/null differ diff --git a/ProcessNoST/lib/mm.mysql-2.0.14-bin.jar b/ProcessNoST/lib/mm.mysql-2.0.14-bin.jar deleted file mode 100644 index 32f04104..00000000 Binary files a/ProcessNoST/lib/mm.mysql-2.0.14-bin.jar and /dev/null differ diff --git a/ProcessNoST/lib/pride.jar b/ProcessNoST/lib/pride.jar deleted file mode 100644 index 04552c74..00000000 Binary files a/ProcessNoST/lib/pride.jar and /dev/null differ diff --git a/ProcessNoST/lib/pride2.2.0-plugin.zip b/ProcessNoST/lib/pride2.2.0-plugin.zip deleted file mode 100644 index 38afc7b4..00000000 Binary files a/ProcessNoST/lib/pride2.2.0-plugin.zip and /dev/null differ diff --git a/ProcessNoST/src/de/tklsoft/processnost/server/database/DatabaseLocator.java b/ProcessNoST/src/de/tklsoft/processnost/server/database/DatabaseLocator.java deleted file mode 100644 index a9cdf599..00000000 --- a/ProcessNoST/src/de/tklsoft/processnost/server/database/DatabaseLocator.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Created on 09.09.2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package de.tklsoft.processnost.server.database; - -import de.mathema.pride.DatabaseFactory; -import de.mathema.pride.ResourceAccessor; -import de.mathema.pride.ResourceAccessorJ2SE; -import de.tklsoft.processnost.shared.ProcessNoSTProperties; - -/** - * @author krallt - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public final class DatabaseLocator { - private static DatabaseLocator instance = null; - - private DatabaseLocator(){ - ProcessNoSTProperties props = ProcessNoSTProperties.getInstance(); - ResourceAccessor accessor = new ResourceAccessorJ2SE(null); - DatabaseFactory.setResourceAccessor(accessor); -// DatabaseFactory.setDatabaseName(props.get.getProperty("pride.db")); - } - - public static synchronized DatabaseLocator getInstance(){ - if (instance == null){ - instance = new DatabaseLocator(); - } - return instance; - } - -} diff --git a/ProcessNoST/src/de/tklsoft/processnost/server/engine/ProcessNoSTEngine.java b/ProcessNoST/src/de/tklsoft/processnost/server/engine/ProcessNoSTEngine.java deleted file mode 100644 index 25414785..00000000 --- a/ProcessNoST/src/de/tklsoft/processnost/server/engine/ProcessNoSTEngine.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Created on 09.09.2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package de.tklsoft.processnost.server.engine; - -/** - * @author krallt - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class ProcessNoSTEngine { - - private ProcessNoSTEngine(){ - // noch eine Menge zu tun... - } - - public static void main(String[] args) { - new ProcessNoSTEngine(); - } -} diff --git a/ProcessNoST/src/de/tklsoft/processnost/shared/ProcessNoSTProperties.java b/ProcessNoST/src/de/tklsoft/processnost/shared/ProcessNoSTProperties.java deleted file mode 100644 index 9100e37f..00000000 --- a/ProcessNoST/src/de/tklsoft/processnost/shared/ProcessNoSTProperties.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Created on 09.09.2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package de.tklsoft.processnost.shared; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Properties; - -/** - * @author krallt - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public final class ProcessNoSTProperties { - - private static ProcessNoSTProperties instance = null; - - private final String propertiesLocation; - private final Properties properties; - - private final String PROPERTY_DRIVER = "db_driver"; - private final String PROPERTY_PORT = "db_port"; - private final String PROPERTY_HOST = "db_host"; - private final String PROPERTY_USER = "db_user"; - private final String PROPERTY_PASSWORD = "db_password"; - - private ProcessNoSTProperties(){ - propertiesLocation = System.getProperty("user.home") + File.separator + "processnost.properties"; - properties = new Properties(); - FileInputStream inputStream = null; - try { - inputStream = new FileInputStream(propertiesLocation); - } catch (FileNotFoundException e) { - // Datei existiert noch nicht. Template wird angelegt - properties.setProperty(PROPERTY_DRIVER, "org.gjt.mm.mysql.Driver"); - properties.setProperty(PROPERTY_PORT, ""); - properties.setProperty(PROPERTY_HOST, ""); - properties.setProperty(PROPERTY_USER, ""); - properties.setProperty(PROPERTY_PASSWORD, ""); - save(); - try { - inputStream = new FileInputStream(propertiesLocation); - } catch (FileNotFoundException e2) { - // Nun kann es nicht mehr passieren. - e2.printStackTrace(); - } - } - try { - properties.load(inputStream); - inputStream.close(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - - public static synchronized ProcessNoSTProperties getInstance(){ - if (instance == null){ - instance = new ProcessNoSTProperties(); - } - return instance; - } - - public String getDbDriver(){ - return properties.getProperty(PROPERTY_DRIVER); - } - - public String getDbHost(){ - return properties.getProperty(PROPERTY_HOST); - } - - public String getDbPort(){ - return properties.getProperty(PROPERTY_PORT); - } - public String getDbUser(){ - return properties.getProperty(PROPERTY_USER); - } - public String getDbPassword(){ - return properties.getProperty(PROPERTY_PASSWORD); - } - - private void save(){ - File aFile = new File(propertiesLocation); - try { - aFile.createNewFile(); - FileOutputStream outputStream = new FileOutputStream(aFile); - properties.store(outputStream, "Property-File for ProcessNoST"); - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/README.md b/README.md new file mode 100644 index 00000000..ed6d1047 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# appleJuice Client GUI + +![](https://img.shields.io/github/license/applejuicenet/gui-java.svg) +![](https://img.shields.io/github/release/applejuicenet/gui-java.svg) +![](https://img.shields.io/github/downloads/applejuicenet/setup/total) +![](https://github.com/applejuicenet/gui-java/workflows/release/badge.svg) + +Dieses GUI ist das grafisches Interface (Graphical User Interface) für den appleJuice Core. + +## Installation + +### Windows + +Bitte das Setup von [hier](https://github.com/applejuicenet/setup/releases) oder die `AJCoreGUI.zip` von [hier](https://github.com/applejuicenet/gui-java/releases) nehmen. + +### macOS + +- per [Homebrew](https://brew.sh) installieren `brew cask install applejuicenet/packages/applejuice-gui` +- oder die `AJCoreGUI.masOS.zip` von [hier](https://github.com/applejuicenet/gui-java/releases) nehmen + +### Linux + +Für Linux wurde eine `snap` Paket zusammengestellt. + +[![Installieren vom Snap Store](https://snapcraft.io/static/images/badges/de/snap-store-white.svg)](https://snapcraft.io/applejuice-gui) + +## Themes + +Das GUI hat einen Theme Support, weitere Themes gibts [hier](https://github.com/l2fprod/javootoo.com/tree/master/plaf/skinlf/themepacks) + +## Changelog + +Ein aktuelles Changelog befindet sich [hier](CHANGELOG.md) + +## mehr Informationen Button + +Der `Suche nach mehr Informationen` Button im Kontextmenü öffnet eine URL, mit dem dahinterliegenden `ajfsp` Link als GET Parameter. + +Dafür muss im `~/appleJuice/gui/` Ordner eine `rel.properties` Datei mit folgender Konfiguration vorhanden sein (wird automatisch angelegt): + +```ini +host=https://relinfo.tld/api/ajfsp/?link=%s +``` + +Das letzte `%s` wird mit dem vollständigen `ajfsp` Link ersetzt (urlencoded). + +### neues Release in dieser Reihenfolge erstellen + +```bash +mvn versions:set \ + -DgroupId=de.applejuicenet.client.gui \ + -DartifactId=AJCoreGUI \ + -DgenerateBackupPoms=false \ + -DoldVersion="*" \ + -N versions:update-child-modules \ + -DnewVersion=0.83.3 +``` + +2. Changelog anpassen +3. Änderungen committen und mit der neuen Version taggen +4. die github action erstellt zum Tag das Release mit passenden Assets diff --git a/ajcorefassade/.classpath b/ajcorefassade/.classpath deleted file mode 100644 index 7a3ef36a..00000000 --- a/ajcorefassade/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="tools/xercesImpl-2.8.1.jar"/> - <classpathentry kind="lib" path="tools/xml-apis.jar"/> - <classpathentry kind="lib" path="tools/gson-2.1.jar"/> - <classpathentry kind="output" path="classes"/> -</classpath> diff --git a/ajcorefassade/.project b/ajcorefassade/.project deleted file mode 100644 index 57cfe3fe..00000000 --- a/ajcorefassade/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>ajcoreFassade</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/ajcorefassade/.settings/org.eclipse.jdt.core.prefs b/ajcorefassade/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 52cbd677..00000000 --- a/ajcorefassade/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,69 +0,0 @@ -#Tue Jan 18 12:26:18 CET 2005 -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -eclipse.preferences.version=1 -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled diff --git a/ajcorefassade/build/build.xml b/ajcorefassade/build/build.xml deleted file mode 100644 index c648766f..00000000 --- a/ajcorefassade/build/build.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE project []> -<project name="ajcorefassade" default="create-jar" basedir=".."> - - <taskdef name="pack" classname="org.sadun.util.ant.Pack" classpath="${basedir}/tools/pack.jar" /> - - <!-- component directories ... --> - <property name="srcdir" location="${basedir}/src" /> - <property name="compiledir" location="${basedir}/classes" /> - - <property name="xercesImpl.jar" location="${basedir}/tools/xercesImpl.jar" /> - <property name="xml-apis.jar" location="${basedir}/tools/xml-apis.jar" /> - <property name="gson-2.1.jar" location="${basedir}/tools/gson-2.1.jar" /> - - <path id="lib.path"> - <pathelement location="${xercesImpl.jar}" /> - <pathelement location="${xml-apis.jar}" /> - <pathelement location="${gson-2.1.jar}" /> - </path> - - <!-- remove class files, DavaDoc files and test results ... --> - <target name="clean" description="deletes class files"> - <delete includeEmptyDirs="true"> - <fileset dir="${compiledir}" casesensitive="false"> - <include name="**/*.class" /> - <exclude name="cvs" /> - <exclude name="readme.txt" /> - </fileset> - </delete> - </target> - - <target name="compile" description="compiles ajcorefassade"> - <javac srcdir="${srcdir}" encoding="cp1252" destdir="${compiledir}" debug="true"> - <classpath> - <path refid="lib.path" /> - </classpath> - </javac> - </target> - - <target name="rebuild" depends="clean, compile" description="cleans and compiles ajcorefassade"> - </target> - - <target name="create-jar" depends="compile" description="builds ajcorefassade.jar"> - <pack classes="org.apache.xerces.parsers.XML11Configuration, - org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl,org.apache.xerces.parsers.IntegratedParserConfiguration,com.google.gson.GsonBuilder" targetJar="${basedir}/ajcorefassade.jar" excludePkg="java,javax,sun"> - <classpath> - <pathelement path="${compiledir}" /> - <path refid="lib.path" /> - </classpath> - <additionalclass name="org.apache.xerces.parsers.SAXParser" /> - <additionalfileset dir="${compiledir}" excludes="**/*.txt **/*.dep2" /> - </pack> - </target> - - <target name="complete" depends="create-jar" description="builds ajcorefassade"> - </target> -</project> diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/DateDeserializer.java b/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/DateDeserializer.java deleted file mode 100644 index 9e959eb4..00000000 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/DateDeserializer.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.applejuicenet.client.fassade.controller.json; - -import java.lang.reflect.Type; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; - -public class DateDeserializer implements JsonDeserializer<Date> -{ - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException - { - String dateAsString = json.getAsJsonPrimitive().getAsString(); - dateAsString = dateAsString.substring(0, 19); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); - try - { - return formater.parse(dateAsString); - } - catch (ParseException e) - { - throw new RuntimeException(e); - } - } -} \ No newline at end of file diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseInfoJsonLoader.java b/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseInfoJsonLoader.java deleted file mode 100644 index 5c1056c1..00000000 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseInfoJsonLoader.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.fassade.controller.json; - -import java.io.File; -import java.io.FileInputStream; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import de.applejuicenet.client.fassade.shared.ProxySettings; -import de.applejuicenet.client.fassade.shared.ReleaseInfo; -import de.applejuicenet.client.fassade.shared.WebsiteContentLoader; - -public class ReleaseInfoJsonLoader -{ - private static final Map<String, ReleaseCacheObject> releasesCache = new HashMap<String, ReleaseCacheObject>(); - private static final long CACHE_TIMEOUT = 300000; - private final ReleaseInfo releaseInfo; - private final ProxySettings proxy; - private final String hash; - private static String releaseInfoHost = null; - private static Integer releaseInfoPort; - - public ReleaseInfoJsonLoader(String hash, ProxySettings proxy) - { - if (null == releaseInfoHost) - { - Properties props = new Properties(); - File aFile = new File(System.getProperty("user.dir") + File.separator + "ajcore.properties"); - if (aFile.exists()) - { - try - { - FileInputStream fiS = new FileInputStream(aFile); - props.load(fiS); - fiS.close(); - releaseInfoHost = props.getProperty("releaseinfo.host"); - String tmp = props.getProperty("releaseinfo.port", "80"); - releaseInfoPort = Integer.parseInt(tmp); - } - catch (Exception e) - { - // nix zu tun - } - } - if (null == releaseInfoHost) - { - releaseInfoHost = "http://applefiles.cc"; - } - if (null == releaseInfoPort) - { - releaseInfoPort = 80; - } - } - this.hash = hash; - releaseInfo = new ReleaseInfo(releaseInfoHost, hash); - this.proxy = proxy; - } - - public ReleaseInfo getReleaseInfo() throws Exception - { - ReleaseCacheObject releaseCacheObject = releasesCache.get(hash); - - if (null != releaseCacheObject) - { - if (releaseCacheObject.getTimestamp() + CACHE_TIMEOUT > System.currentTimeMillis()) - { - return releaseCacheObject.getReleaseInfo(); - } - else - { - releasesCache.remove(hash); - } - } - - String releaseDataTmp = - WebsiteContentLoader.getWebsiteContent(proxy, releaseInfoHost, releaseInfoPort, "/api/get_link_info/?hash=" + hash); - - if ("no result".equals(releaseDataTmp)) - { - releaseCacheObject = new ReleaseCacheObject(System.currentTimeMillis(), null); - releasesCache.put(hash, releaseCacheObject); - return null; - } - - GsonBuilder gsonb = new GsonBuilder(); - gsonb.registerTypeAdapter(Date.class, new DateDeserializer()); - Gson gson = gsonb.create(); - - ReleaseinfoVO data = gson.fromJson(releaseDataTmp, ReleaseinfoVO.class); - - releaseInfo.setTitle(data.getTitle()); - releaseInfo.setCategory(data.getCategory()); - releaseInfo.setViewsCurrentMonth(data.getHitsInMonth()); - releaseInfo.setViewsTotal(data.getHits()); - releaseInfo.setFormat(data.getFormat()); - releaseInfo.setDescription(data.getLink()); - releaseInfo.setFsk18(data.isFsk()); - releaseInfo.setGenres(data.getGenre()); - - releaseInfo.setImage(data.getImg()); - - if (data.getLanguage() != null) - { - releaseInfo.setLanguage(data.getLanguage()); - releaseInfo.setLanguageImage(data.getLanguageImg()); - } - releaseInfo.setQuality(data.getQualiInfo()); - releaseInfo.setReleaseDate(data.getCreated()); - - releaseCacheObject = new ReleaseCacheObject(System.currentTimeMillis(), releaseInfo); - releasesCache.put(hash, releaseCacheObject); - - return releaseInfo; - - } - - private class ReleaseCacheObject - { - private long timestamp; - private ReleaseInfo releaseInfo; - - public ReleaseCacheObject(long timestamp, ReleaseInfo releaseInfo) - { - super(); - this.timestamp = timestamp; - this.releaseInfo = releaseInfo; - } - - public ReleaseInfo getReleaseInfo() - { - return releaseInfo; - } - - public long getTimestamp() - { - return timestamp; - } - } -} diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseinfoVO.java b/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseinfoVO.java deleted file mode 100644 index 529f63b1..00000000 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/json/ReleaseinfoVO.java +++ /dev/null @@ -1,173 +0,0 @@ -package de.applejuicenet.client.fassade.controller.json; - -import java.util.Date; -import java.util.List; - -public class ReleaseinfoVO -{ - private boolean fsk; - private Date created; - private String qualiInfo; - private long hits; - private String language; - private String link; - private String title; - private Date updated; - private String format; - private String category_link; - private String img; - private String languageImg; - private long hitsInMonth; - private String category; - private List<String> genre; - - public boolean isFsk() - { - return fsk; - } - - public void setFsk(boolean fsk) - { - this.fsk = fsk; - } - - public Date getCreated() - { - return created; - } - - public void setCreated(Date created) - { - this.created = created; - } - - public String getQualiInfo() - { - return qualiInfo; - } - - public void setQualiInfo(String qualiInfo) - { - this.qualiInfo = qualiInfo; - } - - public long getHits() - { - return hits; - } - - public void setHits(long hits) - { - this.hits = hits; - } - - public String getLanguage() - { - return language; - } - - public void setLanguage(String language) - { - this.language = language; - } - - public String getLink() - { - return link; - } - - public void setLink(String link) - { - this.link = link; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public Date getUpdated() - { - return updated; - } - - public void setUpdated(Date updated) - { - this.updated = updated; - } - - public String getFormat() - { - return format; - } - - public void setFormat(String format) - { - this.format = format; - } - - public String getCategory_link() - { - return category_link; - } - - public void setCategory_link(String category_link) - { - this.category_link = category_link; - } - - public String getLanguageImg() - { - return languageImg; - } - - public void setLanguageImg(String languageImg) - { - this.languageImg = languageImg; - } - - public long getHitsInMonth() - { - return hitsInMonth; - } - - public void setHitsInMonth(long hitsInMonth) - { - this.hitsInMonth = hitsInMonth; - } - - public String getCategory() - { - return category; - } - - public void setCategory(String category) - { - this.category = category; - } - - public String getImg() - { - return img; - } - - public void setImg(String img) - { - this.img = img; - } - - public List<String> getGenre() - { - return genre; - } - - public void setGenre(List<String> genre) - { - this.genre = genre; - } -} diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ReleaseInfo.java b/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ReleaseInfo.java deleted file mode 100644 index 5de02e20..00000000 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ReleaseInfo.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2006 TKLSoft.de All rights reserved. - */ - -package de.applejuicenet.client.fassade.shared; - -import java.net.MalformedURLException; -import java.net.URL; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class ReleaseInfo -{ - private final String host; - private final String md5; - private String title = null; - private Date releaseDate = null; - private String category = null; - private List<String> genres = new ArrayList<String>(); - private String language = null; - private URL languageImage = null; - private String format = null; - private Long viewsTotal = null; - private Long viewsCurrentMonth = null; - private boolean fsk18 = false; - private URL imageURL = null; - private URL descriptionURL = null; - private String quality; - - public ReleaseInfo(String host, String md5) - { - this.host = host; - this.md5 = md5; - } - - public String getMd5() - { - return md5; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public Date getReleaseDate() - { - return releaseDate; - } - - public void setReleaseDate(Date releaseDate) - { - this.releaseDate = releaseDate; - } - - public String getCategory() - { - return category; - } - - public void setCategory(String category) - { - this.category = category; - } - - public List<String> getGenres() - { - return genres; - } - - public void setGenres(List<String> genres) - { - this.genres = genres; - } - - public String getLanguage() - { - return language; - } - - public void setLanguage(String language) - { - this.language = language; - } - - public URL getLanguageImage() - { - return languageImage; - } - - public void setLanguageImage(String languageImage) - { - try - { - this.languageImage = new URL(host + languageImage); - } - catch (MalformedURLException e) - { - } - } - - public String getFormat() - { - return format; - } - - public void setFormat(String format) - { - this.format = format; - } - - public Long getViewsTotal() - { - return viewsTotal; - } - - public void setViewsTotal(Long viewsTotal) - { - this.viewsTotal = viewsTotal; - } - - public Long getViewsCurrentMonth() - { - return viewsCurrentMonth; - } - - public void setViewsCurrentMonth(Long viewsCurrentMonth) - { - this.viewsCurrentMonth = viewsCurrentMonth; - } - - public URL getImageURL() - { - return imageURL; - } - - public void setImage(String imageLink) - { - try - { - imageURL = new URL(host + imageLink); - } - catch (MalformedURLException e) - { - } - } - - public URL getDescriptionURL() - { - return descriptionURL; - } - - public void setDescription(String descriptionLink) - { - try - { - descriptionURL = new URL(host + descriptionLink); - } - catch (MalformedURLException e) - { - } - } - - public boolean isFsk18() - { - return fsk18; - } - - public void setFsk18(boolean fsk18) - { - this.fsk18 = fsk18; - } - - public String getQuality() - { - return quality; - } - - public void setQuality(String quality) - { - this.quality = quality; - } - -} diff --git a/ajcorefassade/tools/gson-2.1.jar b/ajcorefassade/tools/gson-2.1.jar deleted file mode 100644 index b85f091a..00000000 Binary files a/ajcorefassade/tools/gson-2.1.jar and /dev/null differ diff --git a/ajcorefassade/tools/pack.jar b/ajcorefassade/tools/pack.jar deleted file mode 100644 index ca3f1a69..00000000 Binary files a/ajcorefassade/tools/pack.jar and /dev/null differ diff --git a/ajcorefassade/tools/xercesImpl-2.8.1.jar b/ajcorefassade/tools/xercesImpl-2.8.1.jar deleted file mode 100644 index 3b351f6e..00000000 Binary files a/ajcorefassade/tools/xercesImpl-2.8.1.jar and /dev/null differ diff --git a/ajcorefassade/tools/xercesImpl.jar b/ajcorefassade/tools/xercesImpl.jar deleted file mode 100644 index 14c3162c..00000000 Binary files a/ajcorefassade/tools/xercesImpl.jar and /dev/null differ diff --git a/ajcorefassade/tools/xml-apis.jar b/ajcorefassade/tools/xml-apis.jar deleted file mode 100644 index 2dd83771..00000000 Binary files a/ajcorefassade/tools/xml-apis.jar and /dev/null differ diff --git a/ajtray/.classpath b/ajtray/.classpath deleted file mode 100644 index 5792f530..00000000 --- a/ajtray/.classpath +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/AJClientGUI"/> - <classpathentry kind="lib" path="lib/tklcontrols.jar"/> - <classpathentry kind="output" path="classes"/> -</classpath> diff --git a/ajtray/.project b/ajtray/.project deleted file mode 100644 index 0a464488..00000000 --- a/ajtray/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>ajtray</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/ajtray/build/build.xml b/ajtray/build/build.xml deleted file mode 100644 index c91ca76f..00000000 --- a/ajtray/build/build.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE project []> -<project name="ajtray" default="create-jar" basedir=".."> - - <!-- component directories ... --> - <property name="srcdir" location="${basedir}/src" /> - <property name="compiledir" location="${basedir}/classes" /> - - <property name="tklcontrols.jar" location="${basedir}/lib/tklcontrols.jar" /> - - <path id="lib.path"> - <pathelement location="${tklcontrols.jar}" /> - </path> - - <!-- remove class files, DavaDoc files and test results ... --> - <target name="clean" description="deletes class files"> - <delete includeEmptyDirs="true"> - <fileset dir="${compiledir}" casesensitive="false"> - <include name="**/*.class" /> - <exclude name="cvs" /> - <exclude name="readme.txt" /> - </fileset> - </delete> - </target> - - <target name="compile"> - <javac srcdir="${srcdir}" encoding="cp1252" destdir="${compiledir}" debug="true"> - <classpath> - <path refid="lib.path" /> - </classpath> - </javac> - </target> - - <target name="rebuild" depends="clean, compile"> - </target> - - <target name="create-jar" depends="compile"> - <delete file="${basedir}/ajtray.jar" quiet="true" /> - <jar destfile="${basedir}/ajtray.jar" basedir="${compiledir}" /> - </target> - - <target name="complete" depends="create-jar"> - </target> -</project> diff --git a/ajtray/lib/tklcontrols.jar b/ajtray/lib/tklcontrols.jar deleted file mode 100644 index e940ee85..00000000 Binary files a/ajtray/lib/tklcontrols.jar and /dev/null differ diff --git a/AJClientGUI/Doku/ajclientguicore.pdf b/doc/ajclientguicore.pdf similarity index 100% rename from AJClientGUI/Doku/ajclientguicore.pdf rename to doc/ajclientguicore.pdf diff --git a/AJClientGUI/Doku/xml/information.xml b/doc/xml/information.xml similarity index 100% rename from AJClientGUI/Doku/xml/information.xml rename to doc/xml/information.xml diff --git a/AJClientGUI/Doku/xml/modified.xml b/doc/xml/modified.xml similarity index 100% rename from AJClientGUI/Doku/xml/modified.xml rename to doc/xml/modified.xml diff --git a/AJClientGUI/Doku/xml/sessions_modified.xml b/doc/xml/sessions_modified.xml similarity index 100% rename from AJClientGUI/Doku/xml/sessions_modified.xml rename to doc/xml/sessions_modified.xml diff --git a/AJClientGUI/Doku/xml/settings.xml b/doc/xml/settings.xml similarity index 100% rename from AJClientGUI/Doku/xml/settings.xml rename to doc/xml/settings.xml diff --git a/AJClientGUI/Doku/xml/share.xml b/doc/xml/share.xml similarity index 100% rename from AJClientGUI/Doku/xml/share.xml rename to doc/xml/share.xml diff --git a/modules/AJCoreGUI/pom.xml b/modules/AJCoreGUI/pom.xml new file mode 100644 index 00000000..c0df59ef --- /dev/null +++ b/modules/AJCoreGUI/pom.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client.gui</groupId> + <artifactId>AJCoreGUI</artifactId> + <packaging>jar</packaging> + <version>0.83.3</version> + + <parent> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <relativePath>./../../pom.xml</relativePath> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <groupId>skinlf</groupId> + <artifactId>skinlf</artifactId> + <version>1.2.3</version> + </dependency> + <dependency> + <groupId>tablelayout</groupId> + <artifactId>TableLayout</artifactId> + <version>20050920</version> + </dependency> + <dependency> + <groupId>com.jgoodies</groupId> + <artifactId>looks</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.6.2</version> + </dependency> + <dependency> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>2.0.2</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>prepare-package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>../../resources/needed_jars/</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.2.0</version> + <configuration> + <archive> + <addMavenDescriptor>false</addMavenDescriptor> + <manifestEntries> + <Built-By>appleJuice maintainer</Built-By> + </manifestEntries> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + <addClasspath>true</addClasspath> + <classpathPrefix>./needed_jars/</classpathPrefix> + <mainClass>de.applejuicenet.client.AppleJuiceClient</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/AppleJuiceClient.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/AppleJuiceClient.java new file mode 100644 index 00000000..38cbea67 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/AppleJuiceClient.java @@ -0,0 +1,485 @@ +/* + * Copyright 2006 TKLSoft.de All rights reserved. + */ + +package de.applejuicenet.client; + +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.HeadlessException; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.KeyEvent; + +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; + +import java.net.Socket; + +import java.text.SimpleDateFormat; + +import java.util.Date; + +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +import de.applejuicenet.client.gui.VersionChecker; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.FileAppender; +import org.apache.log4j.HTMLLayout; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.PatternLayout; + +import de.applejuicenet.client.fassade.ApplejuiceFassade; +import de.applejuicenet.client.fassade.controller.CoreConnectionSettingsHolder; +import de.applejuicenet.client.fassade.exception.IllegalArgumentException; +import de.applejuicenet.client.fassade.shared.AJSettings; +import de.applejuicenet.client.gui.AppleJuiceDialog; +import de.applejuicenet.client.gui.components.listener.KeyStates; +import de.applejuicenet.client.gui.connect.ConnectFrame; +import de.applejuicenet.client.gui.connect.QuickConnectionSettingsDialog; +import de.applejuicenet.client.gui.controller.LanguageSelector; +import de.applejuicenet.client.gui.controller.LinkListener; +import de.applejuicenet.client.gui.controller.OptionsManagerImpl; +import de.applejuicenet.client.gui.controller.PositionManager; +import de.applejuicenet.client.gui.controller.PositionManagerImpl; +import de.applejuicenet.client.gui.wizard.WizardDialog; +import de.applejuicenet.client.shared.ConnectionSettings; +import de.applejuicenet.client.shared.IconManager; +import de.applejuicenet.client.shared.SoundPlayer; +import de.applejuicenet.client.shared.Splash; + +/** + * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClient.java,v 1.109 2009/02/12 13:11:40 maj0r Exp $ + * + * <p>Titel: AppleJuice Client-GUI</p> + * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> + * <p>Copyright: General Public License</p> + * + * @author: Maj0r [aj@tkl-soft.de] + */ +public class AppleJuiceClient { + public static Splash splash = null; + private static Logger logger = Logger.getLogger(AppleJuiceClient.class); + private static String fileAppenderPath; + private static HTMLLayout layout; + private static ApplejuiceFassade ajFassade = null; + private static CoreConnectionSettingsHolder conn = null; + private static String rootDirectory = null; + + /** + * @return Returns the path of the Client-GUI. + */ + public static String getPath() { + return getRootDirectory(); + } + + public static synchronized ApplejuiceFassade getAjFassade() { + if (ajFassade == null) { + ConnectionSettings rm = OptionsManagerImpl.getInstance().getRemoteSettings(); + + try { + conn = new CoreConnectionSettingsHolder(rm.getHost(), rm.getXmlPort(), rm.getOldPassword(), false); + ajFassade = new ApplejuiceFassade(conn); + } catch (IllegalArgumentException e) { + logger.error(e); + } + } + + return ajFassade; + } + + public static CoreConnectionSettingsHolder getCoreConnectionSettingsHolder() { + return conn; + } + + public static HTMLLayout getLoggerHtmlLayout() { + return layout; + } + + public static String getLoggerFileAppenderPath() { + return fileAppenderPath; + } + + public static void main(String[] args) { + AppleJuiceClientTG tg = new AppleJuiceClientTG(); + final String[] myargs = args; + Runnable runnable = () -> AppleJuiceClient.runmain(myargs); + + Thread t = new Thread(tg, runnable, "appleJuiceCoreGUI"); + + t.start(); + } + + public static void runmain(String[] args) { + boolean processLink = false; + String link = ""; + boolean doubleInstance = false; + LinkListener linkListener = null; + + if (args != null && args.length > 0) { + try { + for (String curArg : args) { + if (curArg.indexOf("-path=") != -1) { + System.setProperty("user.dir", curArg.substring(6)); + break; + } + } + + boolean hilfeAusgegeben = false; + + for (String curArg : args) { + if (curArg.compareTo("-help") == 0) { + if (hilfeAusgegeben) { + continue; + } + + System.out.println(); + System.out.println(" -help Diese Uebersicht."); + System.out.println(" -path=<pfad> Ausfuehrpfad setzen. Alles im GUI ist relativ zu diesem."); + System.out.println(" -link=<md5Passwort|link> ajfsp-Link ans GUI uebergeben. " + + " Das GUI wird ggf gestartet."); + System.out.println(); + hilfeAusgegeben = true; + } else if (curArg.contains("-command=")) { + if (linkListener == null) { + try { + linkListener = new LinkListener(); + } catch (IOException ex) { + //bereits ein GUI vorhanden, also GUI schliessen + doubleInstance = true; + } + } + + if (doubleInstance) { + int PORT = OptionsManagerImpl.getInstance().getLinkListenerPort(); + String passwort = OptionsManagerImpl.getInstance().getRemoteSettings().getOldPassword(); + Socket socket = new Socket("localhost", PORT); + PrintStream out = new PrintStream(socket.getOutputStream()); + DataInputStream in = new DataInputStream(socket.getInputStream()); + + out.println(passwort + "|" + curArg); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line = reader.readLine(); + + System.out.println(line); + socket.close(); + System.exit(1); + } else { + System.out.println("appleJuice-JavaGUI nicht gestartet"); + System.exit(1); + } + } else if (curArg.startsWith("ajfsp://") || (curArg.contains("-link=") && curArg.length() > "-link=".length() + 1)) { + link = curArg.startsWith("ajfsp://") ? curArg : curArg.substring(curArg.indexOf("-link=") + "-link=".length()); + link = link.replaceAll("%7C", "|"); + + if (linkListener == null) { + try { + linkListener = new LinkListener(); + } catch (IOException ex) { + //bereits ein GUI vorhanden, also GUI schliessen + doubleInstance = true; + } + } + + if (doubleInstance) { + int PORT = OptionsManagerImpl.getInstance().getLinkListenerPort(); + String passwort = OptionsManagerImpl.getInstance().getRemoteSettings().getOldPassword(); + Socket socket = new Socket("localhost", PORT); + PrintStream out = new PrintStream(socket.getOutputStream()); + + out.println(passwort + "|" + curArg); + socket.close(); + //war nur Linkprocessing, also GUI schliessen + System.exit(1); + } else { + linkListener.processLink(link, ""); + } + } + } + } catch (IOException ioE) { + //Keine bisherige GUI-Instanz vorhanden, also GUI oeffnen + processLink = true; + } catch (Exception e) { + System.exit(1); + } + } + + if (linkListener == null) { + try { + linkListener = new LinkListener(); + } catch (IOException ex) { + //bereits ein GUI vorhanden, also GUI schliessen + doubleInstance = true; + } + } + + if (doubleInstance) { + //bereits ein GUI vorhanden, also GUI schliessen + JOptionPane.showMessageDialog(new Frame(), "Eine Instanz des GUIs ist bereits in Verwendung.", "appleJuice Client", JOptionPane.ERROR_MESSAGE); + System.exit(1); + } + + if (processLink) { + linkListener.processLink(link, ""); + } + + boolean isDebug = System.getProperty("Debug") != null; + + if (isDebug) { + ConsoleAppender consoleAppender = new ConsoleAppender(new PatternLayout("%d [%t] %-5p %c - %m%n")); + + Logger.getRootLogger().addAppender(consoleAppender); + Logger.getRootLogger().setLevel(Level.DEBUG); + } else { + Logger rootLogger = Logger.getRootLogger(); + + String datum = new SimpleDateFormat("ddMMyyyy_HHmmss").format(new Date(System.currentTimeMillis())); + String dateiName; + + dateiName = datum + ".html"; + layout = new HTMLLayout(); + layout.setTitle("appleJuice-GUI-Log " + datum); + layout.setLocationInfo(true); + Level logLevel = OptionsManagerImpl.getInstance().getLogLevel(); + + try { + String path = getRootDirectory() + File.separator + "logs"; + File aFile = new File(path); + + if (!aFile.exists()) { + aFile.mkdir(); + } + + fileAppenderPath = path + File.separator + dateiName; + if (logLevel != Level.OFF) { + FileAppender fileAppender = new FileAppender(layout, fileAppenderPath); + + rootLogger.removeAllAppenders(); + rootLogger.addAppender(fileAppender); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + } + + rootLogger.setLevel(logLevel); + } + + if (System.getProperty("os.name").toLowerCase().contains("linux")) { + try { + Toolkit xToolkit = Toolkit.getDefaultToolkit(); + java.lang.reflect.Field awtAppClassNameField = xToolkit.getClass().getDeclaredField("awtAppClassName"); + awtAppClassNameField.setAccessible(true); + awtAppClassNameField.set(xToolkit, "AJCoreGUI"); + } catch (Exception ignored) { + } + } + + try { + String nachricht = "appleJuice-GUI " + AppleJuiceDialog.getVersion() + " wird gestartet..."; + ConnectFrame connectFrame = new ConnectFrame(); + + splash = new Splash(connectFrame, IconManager.getInstance().getIcon("splashscreen").getImage(), 0, 100); + KeyStates ks = new KeyStates(); + + splash.addKeyListener(ks); + splash.setVisible(true); + try { + if (OptionsManagerImpl.getInstance().isThemesSupported()) { + java.lang.reflect.Method method = JFrame.class.getMethod("setDefaultLookAndFeelDecorated", + new Class[]{boolean.class}); + + method.invoke(null, new Object[]{Boolean.TRUE}); + + method = JDialog.class.getMethod("setDefaultLookAndFeelDecorated", new Class[]{boolean.class}); + method.invoke(null, new Object[]{Boolean.TRUE}); + } + } catch (Exception e) { + if (logger.isEnabledFor(Level.FATAL)) { + logger.fatal("Programmabbruch", e); + } + } + + if (logger.isEnabledFor(Level.INFO)) { + logger.info(nachricht); + } + + System.out.println(nachricht); + if (logger.isEnabledFor(Level.INFO)) { + nachricht = "erkanntes GUI-OS: " + System.getProperty("os.name"); + logger.info(nachricht); + nachricht = "erkannte Java-Version: " + System.getProperty("java.version"); + logger.info(nachricht); + } + + String titel = null; + LanguageSelector languageSelector = LanguageSelector.getInstance(); + QuickConnectionSettingsDialog remoteDialog; + + splash.setProgress(5, "Lade Themes..."); + AppleJuiceDialog.initThemes(); + splash.setProgress(10, "Teste Verbindung..."); + boolean showDialog = OptionsManagerImpl.getInstance().shouldShowConnectionDialogOnStartup(); + boolean keyDown = ks.isKeyDown(KeyEvent.VK_SHIFT); + + if (!showDialog) { + showDialog = keyDown; + } + + boolean firstTry = keyDown ? false : true; + int erreichbarkeit = 2; + + if (ajFassade == null) { + getAjFassade(); + } + while (showDialog || (erreichbarkeit = ajFassade.isCoreAvailable()) != 0) { + splash.setVisible(false); + if (!showDialog) { + if (erreichbarkeit == 2) { + titel = languageSelector.getFirstAttrbuteByTagName("mainform.caption"); + nachricht = languageSelector.getFirstAttrbuteByTagName("javagui.startup.fehlversuch"); + SoundPlayer.getInstance().playSound(SoundPlayer.VERWEIGERT); + JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.ERROR_MESSAGE); + } else { + titel = languageSelector.getFirstAttrbuteByTagName("mainform.caption"); + nachricht = languageSelector.getFirstAttrbuteByTagName("mainform.msgdlgtext3"); + SoundPlayer.getInstance().playSound(SoundPlayer.VERWEIGERT); + JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.ERROR_MESSAGE); + } + } + + showDialog = false; + remoteDialog = new QuickConnectionSettingsDialog(connectFrame); + if (firstTry && OptionsManagerImpl.getInstance().isErsterStart()) { + firstTry = false; + remoteDialog.setNieWiederAnzeigen(); + remoteDialog.pressOK(); + } else { + remoteDialog.setVisible(true); + if (remoteDialog.getResult() == QuickConnectionSettingsDialog.ABGEBROCHEN) { + nachricht = languageSelector.getFirstAttrbuteByTagName("javagui.startup.verbindungsfehler"); + nachricht = nachricht.replaceFirst("%s", OptionsManagerImpl.getInstance().getRemoteSettings().getHost()); + JOptionPane.showMessageDialog(connectFrame, nachricht, titel, JOptionPane.OK_OPTION); + logger.fatal(nachricht); + System.out.println("Fehler: " + nachricht); + System.exit(-1); + } + } + + splash.setVisible(true); + } + + SoundPlayer.getInstance().playSound(SoundPlayer.ZUGANG_GEWAEHRT); + + splash.setProgress(20, "Lade Hauptdialog..."); + SwingUtilities.invokeLater(() -> { + final AppleJuiceDialog theApp = new AppleJuiceDialog(); + + splash.setProgress(100, "GUI geladen..."); + PositionManager lm = PositionManagerImpl.getInstance(); + + if (lm.isLegal()) { + theApp.setLocation(lm.getMainXY()); + theApp.setSize(lm.getMainDimension()); + } else { + Toolkit tk = Toolkit.getDefaultToolkit(); + Dimension screenSize = tk.getScreenSize(); + Dimension appScreenSize = new Dimension(screenSize.width, screenSize.height); + Insets insets = tk.getScreenInsets(theApp.getGraphicsConfiguration()); + + appScreenSize.width -= (insets.left + insets.right); + appScreenSize.width = appScreenSize.width / 5 * 4; + appScreenSize.height -= (insets.top + insets.bottom); + appScreenSize.height = appScreenSize.height / 5 * 4; + Point location = new Point((screenSize.width - appScreenSize.width) / 2, + (screenSize.height - appScreenSize.height) / 2); + + lm.setMainXY(location); + lm.setMainDimension(appScreenSize); + theApp.setSize(appScreenSize); + theApp.setLocation(location); + } + + theApp.setVisible(true); + String nachricht1 = "appleJuice-GUI gestartet..."; + + if (logger.isEnabledFor(Level.INFO)) { + logger.info(nachricht1); + } + + System.out.println(nachricht1); + splash.dispose(); + if (OptionsManagerImpl.getInstance().isErsterStart()) { + showConnectionWizard(theApp); + } + + boolean UpdateInfo = OptionsManagerImpl.getInstance().getUpdateInfo(); + + if (UpdateInfo) { + VersionChecker.check(); + } + }); + + } catch (Exception e) { + if (logger.isEnabledFor(Level.FATAL)) { + logger.fatal("Programmabbruch", e); + } + + System.exit(-1); + } + } + + private static String getRootDirectory() { + if (rootDirectory == null) { + rootDirectory = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui"; + } + + return rootDirectory; + } + + public static void showConnectionWizard(JFrame frame) throws HeadlessException { + WizardDialog wizardDialog = new WizardDialog(frame, true); + Dimension appDimension = wizardDialog.getSize(); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + wizardDialog.setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); + wizardDialog.setVisible(true); + } + + public static boolean showConnectionWizard(JDialog dialog, AJSettings ajSettings) + throws HeadlessException { + WizardDialog wizardDialog = new WizardDialog(dialog, true, ajSettings); + Dimension appDimension = wizardDialog.getSize(); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + wizardDialog.setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); + wizardDialog.setVisible(true); + return wizardDialog.isRegularClosed(); + } + + public static String getPropertiesPath() { + String dir = System.getProperty("user.home") + File.separator + "appleJuice"; + File directory = new File(dir); + + if (!directory.isDirectory()) { + directory.mkdir(); + } + + dir += File.separator + "gui"; + directory = new File(dir); + if (!directory.isDirectory()) { + directory.mkdir(); + } + + dir += File.separator + "ajgui.properties"; + return dir; + } +} diff --git a/AJClientGUI/src/de/applejuicenet/client/AppleJuiceClientTG.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/AppleJuiceClientTG.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/AppleJuiceClientTG.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/AppleJuiceClientTG.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/ApplejuiceFassade.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/ApplejuiceFassade.java similarity index 98% rename from ajcorefassade/src/de/applejuicenet/client/fassade/ApplejuiceFassade.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/ApplejuiceFassade.java index 798d522a..8ed8184b 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/ApplejuiceFassade.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/ApplejuiceFassade.java @@ -17,7 +17,6 @@ import de.applejuicenet.client.fassade.controller.CoreConnectionSettingsHolder; import de.applejuicenet.client.fassade.controller.DataPropertyChangeInformer; import de.applejuicenet.client.fassade.controller.DataUpdateInformer; -import de.applejuicenet.client.fassade.controller.json.ReleaseInfoJsonLoader; import de.applejuicenet.client.fassade.controller.xml.DirectoryXMLHolder; import de.applejuicenet.client.fassade.controller.xml.GetObjectXMLHolder; import de.applejuicenet.client.fassade.controller.xml.InformationXMLHolder; @@ -50,13 +49,11 @@ import de.applejuicenet.client.fassade.shared.HtmlLoader; import de.applejuicenet.client.fassade.shared.NetworkInfo; import de.applejuicenet.client.fassade.shared.ProxySettings; -import de.applejuicenet.client.fassade.shared.ReleaseInfo; import de.applejuicenet.client.fassade.shared.StringConstants; import de.applejuicenet.client.fassade.tools.MD5Encoder; public class ApplejuiceFassade implements CoreConnectionSettingsListener { - public static final String FASSADE_VERSION = "F-1.23"; public static final String MIN_NEEDED_CORE_VERSION = "0.30.146.1203"; public static final String ERROR_MESSAGE = "Unbehandelte Exception"; public static String separator; @@ -1137,12 +1134,6 @@ public void fireSettingsChanged(ITEM item, String oldValue, String newValue) { } - public ReleaseInfo getReleaseInfo(String hash, ProxySettings proxy) - throws Exception - { - return new ReleaseInfoJsonLoader(hash, proxy).getReleaseInfo(); - } - private class CancelThread extends Thread { private Search search; diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/CoreConnectionSettingsHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/CoreConnectionSettingsHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/CoreConnectionSettingsHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/CoreConnectionSettingsHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/DataPropertyChangeInformer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/DataPropertyChangeInformer.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/DataPropertyChangeInformer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/DataPropertyChangeInformer.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/DataUpdateInformer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/DataUpdateInformer.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/DataUpdateInformer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/DataUpdateInformer.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DirectoryDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DirectoryDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DirectoryDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DirectoryDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DirectoryXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DirectoryXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DirectoryXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DirectoryXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DownloadDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DownloadDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DownloadDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DownloadDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DownloadSourceDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DownloadSourceDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/DownloadSourceDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/DownloadSourceDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/GetObjectXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/GetObjectXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/GetObjectXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/GetObjectXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/InformationDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/InformationDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/InformationDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/InformationDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/InformationXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/InformationXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/InformationXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/InformationXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ModifiedXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ModifiedXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ModifiedXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ModifiedXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java similarity index 95% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java index 4dfbfc16..6aa4296d 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/NetworkServerXMLHolder.java @@ -89,7 +89,7 @@ public String[] getNetworkKnownServers() try { - xmlData = WebsiteContentLoader.getWebsiteContent("http://www.applejuicenet.org", 80, "/serverlist/xmllist.php"); + xmlData = WebsiteContentLoader.getWebsiteContent("https://www.applejuicenet.de", 443, "/serverlist/xmllist.php"); if(xmlData == null || xmlData.length() == 0) { return null; diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/PartListDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/PartListDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/PartListDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/PartListDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/PartListXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/PartListXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/PartListXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/PartListXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SearchDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SearchDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SearchDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SearchDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java similarity index 98% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java index 1259574f..70d7c91e 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SecurerXMLHolder.java @@ -28,7 +28,7 @@ * Titel: AppleJuice Client-GUI * </p> * <p> - * Beschreibung: Offizielles GUI f�r den von muhviehstarr entwickelten + * Beschreibung: Offizielles GUI für den von muhviehstarr entwickelten * appleJuice-Core * </p> * <p> diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ServerDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ServerDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ServerDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ServerDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SessionXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SessionXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SessionXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SessionXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SettingsXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SettingsXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/SettingsXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/SettingsXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareDO.java similarity index 95% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareDO.java index a2cc1889..9bc1bdca 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareDO.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareDO.java @@ -140,4 +140,8 @@ public void setSearchCount(long searchCount) { this.searchCount = searchCount; } + + public String getAjfspLink() { + return String.format("ajfsp://file|%s|%s|%s/", getShortfilename(), getCheckSum(), getSize()); + } } diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareEntryDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareEntryDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareEntryDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareEntryDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareXMLHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareXMLHolder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/ShareXMLHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/ShareXMLHolder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/UploadDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/UploadDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/UploadDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/UploadDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/VersionDO.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/VersionDO.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/VersionDO.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/VersionDO.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/WebXMLParser.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/WebXMLParser.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/WebXMLParser.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/WebXMLParser.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java similarity index 96% rename from ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java index 1958ff42..790c665f 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/controller/xml/XMLValueHolder.java @@ -4,10 +4,8 @@ package de.applejuicenet.client.fassade.controller.xml; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.StringReader; +import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.Properties; import org.apache.xerces.parsers.SAXParser; @@ -35,7 +33,8 @@ public void parseProperties(File propertiesFile) throws IllegalArgumentException FileInputStream fiS = new FileInputStream(propertiesFile); values.clear(); - values.load(fiS); + + values.load(new InputStreamReader(fiS, StandardCharsets.UTF_8)); fiS.close(); } catch(Exception e) diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Directory.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Directory.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Directory.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Directory.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Download.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Download.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Download.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Download.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/DownloadSource.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/DownloadSource.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/DownloadSource.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/DownloadSource.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/FileName.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/FileName.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/FileName.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/FileName.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/IdOwner.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/IdOwner.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/IdOwner.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/IdOwner.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Information.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Information.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Information.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Information.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Part.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Part.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Part.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Part.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/PartList.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/PartList.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/PartList.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/PartList.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Search.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Search.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Search.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Search.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/SearchEntry.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/SearchEntry.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/SearchEntry.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/SearchEntry.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Server.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Server.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Server.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Server.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Share.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Share.java similarity index 91% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Share.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Share.java index 89c7ff7e..1bd0829b 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Share.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Share.java @@ -15,8 +15,10 @@ public interface Share extends IdOwner{ int getPrioritaet(); long getAskCount(); - + long getLastAsked(); - + long getSearchCount(); + + String getAjfspLink(); } diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/ShareEntry.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/ShareEntry.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/ShareEntry.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/ShareEntry.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Upload.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Upload.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Upload.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Upload.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/entity/Version.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Version.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/entity/Version.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/entity/Version.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/event/DataPropertyChangeEvent.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/event/DataPropertyChangeEvent.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/event/DataPropertyChangeEvent.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/event/DataPropertyChangeEvent.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/event/DownloadDataPropertyChangeEvent.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/event/DownloadDataPropertyChangeEvent.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/event/DownloadDataPropertyChangeEvent.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/event/DownloadDataPropertyChangeEvent.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/exception/CoreLostException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/CoreLostException.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/exception/CoreLostException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/CoreLostException.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/exception/IllegalArgumentException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/IllegalArgumentException.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/exception/IllegalArgumentException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/IllegalArgumentException.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/exception/NoAccessException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/NoAccessException.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/exception/NoAccessException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/NoAccessException.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/exception/WebSiteNotFoundException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/WebSiteNotFoundException.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/exception/WebSiteNotFoundException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/WebSiteNotFoundException.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/exception/WrongPasswordException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/WrongPasswordException.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/exception/WrongPasswordException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/exception/WrongPasswordException.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/listener/CoreConnectionSettingsListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/CoreConnectionSettingsListener.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/listener/CoreConnectionSettingsListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/CoreConnectionSettingsListener.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/listener/CoreStatusListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/CoreStatusListener.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/listener/CoreStatusListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/CoreStatusListener.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/listener/DataPropertyChangeListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/DataPropertyChangeListener.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/listener/DataPropertyChangeListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/DataPropertyChangeListener.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/listener/DataUpdateListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/DataUpdateListener.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/listener/DataUpdateListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/listener/DataUpdateListener.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/AJSettings.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/AJSettings.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/AJSettings.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/AJSettings.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/FileType.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/FileType.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/FileType.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/FileType.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/HtmlLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/HtmlLoader.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/HtmlLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/HtmlLoader.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/NetworkInfo.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/NetworkInfo.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/NetworkInfo.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/NetworkInfo.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ProxySettings.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ProxySettings.java similarity index 89% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/ProxySettings.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ProxySettings.java index bb9397c5..8a8db171 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ProxySettings.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ProxySettings.java @@ -5,6 +5,8 @@ package de.applejuicenet.client.fassade.shared; +import java.util.Base64; + /** * $Header: * /cvsroot/applejuicejava/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ProxySettings.java,v @@ -64,7 +66,8 @@ public String getUserpass() public void setUserpass(String user, String passwort) { - this.userpass = new sun.misc.BASE64Encoder().encode((user + ":" + passwort).getBytes()); + Base64.Encoder base64Encoder = Base64.getEncoder().withoutPadding(); + this.userpass = base64Encoder.encodeToString((user + ":" + passwort).getBytes()); } public boolean isUse() diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/StringConstants.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/StringConstants.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/StringConstants.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/StringConstants.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java similarity index 87% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java index d2c3d4ab..91ff397d 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/WebsiteContentLoader.java @@ -12,7 +12,9 @@ import java.net.URL; import java.net.URLConnection; +import de.applejuicenet.client.fassade.ApplejuiceFassade; import de.applejuicenet.client.fassade.exception.NoAccessException; +import de.applejuicenet.client.gui.AppleJuiceDialog; /** * $Header: @@ -58,6 +60,9 @@ public static String getWebsiteContent(ProxySettings proxySettings, String websi uc.setRequestProperty("Proxy-Authorization", "Basic " + proxySettings.getUserpass()); } + uc.setRequestProperty("User-Agent", + String.format("AJCoreGUI/%s; Java/%s; (%s/%s)", AppleJuiceDialog.getVersion(), System.getProperty("java.version"), System.getProperty("os.name"), System.getProperty("os.version"))); + InputStream content = uc.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(content)); String line; diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/XMLDecoder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/XMLDecoder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/XMLDecoder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/XMLDecoder.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ZLibUtils.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ZLibUtils.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/ZLibUtils.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ZLibUtils.java diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java similarity index 86% rename from ajcorefassade/src/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java index dab4b068..a897e058 100644 --- a/ajcorefassade/src/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/shared/ZeichenErsetzer.java @@ -32,25 +32,25 @@ public static String korrigiereUmlaute(String text) { temp.replace(index, index + 2, "\""); } while ((index = temp.indexOf("ü")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "ü"); } while ((index = temp.indexOf("Ü")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "Ü"); } while ((index = temp.indexOf("ä")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "ä"); } while ((index = temp.indexOf("Ä")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "Ä"); } while ((index = temp.indexOf("ö")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "ö"); } while ((index = temp.indexOf("Ö")) != -1) { - temp.replace(index, index + 6, ""); + temp.replace(index, index + 6, "Ö"); } while ((index = temp.indexOf("ß")) != -1) { - temp.replace(index, index + 7, ""); + temp.replace(index, index + 7, "ß"); } while ((index = temp.indexOf("&")) != -1) { temp.replace(index, index + 5, ""); diff --git a/ajcorefassade/src/de/applejuicenet/client/fassade/tools/MD5Encoder.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/tools/MD5Encoder.java similarity index 100% rename from ajcorefassade/src/de/applejuicenet/client/fassade/tools/MD5Encoder.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/fassade/tools/MD5Encoder.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/AppleJuiceDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/AppleJuiceDialog.java similarity index 74% rename from AJClientGUI/src/de/applejuicenet/client/gui/AppleJuiceDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/AppleJuiceDialog.java index 8499de08..cdf4a613 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/AppleJuiceDialog.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/AppleJuiceDialog.java @@ -16,8 +16,6 @@ import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.InputEvent; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -32,12 +30,7 @@ import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; +import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -62,13 +55,12 @@ import javax.swing.ToolTipManager; import javax.swing.UIManager; import javax.swing.border.BevelBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import javax.swing.filechooser.FileFilter; import com.l2fprod.gui.plaf.skin.Skin; import com.l2fprod.gui.plaf.skin.SkinLookAndFeel; +import de.applejuicenet.client.gui.tray.TrayLoader; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -81,8 +73,6 @@ import de.applejuicenet.client.fassade.listener.DataUpdateListener; import de.applejuicenet.client.fassade.shared.AJSettings; import de.applejuicenet.client.fassade.shared.NetworkInfo; -import de.applejuicenet.client.fassade.shared.ProxySettings; -import de.applejuicenet.client.fassade.shared.WebsiteContentLoader; import de.applejuicenet.client.gui.about.AboutDialog; import de.applejuicenet.client.gui.controller.LanguageSelector; import de.applejuicenet.client.gui.controller.OptionsManager; @@ -90,7 +80,6 @@ import de.applejuicenet.client.gui.controller.PositionManager; import de.applejuicenet.client.gui.controller.PositionManagerImpl; import de.applejuicenet.client.gui.controller.PropertiesManager; -import de.applejuicenet.client.gui.controller.ProxyManagerImpl; import de.applejuicenet.client.gui.download.DownloadController; import de.applejuicenet.client.gui.download.DownloadPanel; import de.applejuicenet.client.gui.listener.LanguageListener; @@ -100,7 +89,6 @@ import de.applejuicenet.client.gui.server.ServerPanel; import de.applejuicenet.client.gui.share.ShareController; import de.applejuicenet.client.gui.share.SharePanel; -import de.applejuicenet.client.gui.tray.TrayIF; import de.applejuicenet.client.gui.upload.UploadController; import de.applejuicenet.client.gui.upload.UploadPanel; import de.applejuicenet.client.shared.IconManager; @@ -134,15 +122,13 @@ public class AppleJuiceDialog extends TKLFrame implements LanguageListener, DataUpdateListener { - //CVS-Beispiel 0.60.0-1-CVS - public static final String GUI_VERSION = "0.71.2"; - private static Logger logger = Logger.getLogger(AppleJuiceDialog.class); + private static final Logger logger = Logger.getLogger(AppleJuiceDialog.class); private static Map<String, Skin> themes = null; public static boolean rewriteProperties = false; private static AppleJuiceDialog theApp; private static boolean themesInitialized = false; private static boolean useTrayIcon = false; - private static TrayIF trayLoader = null; + private static TrayLoader trayLoader = null; private Information information = null; private RegisterPanel registerPane; private TKLLabel[] statusbar = new TKLLabel[6]; @@ -212,6 +198,10 @@ public AppleJuiceDialog() } } + public static String getVersion() { + return AppleJuiceDialog.class.getPackage().getImplementationVersion(); + } + private void initKeyStrokes() { int tabCount = registerPane.getTabCount(); @@ -219,7 +209,7 @@ private void initKeyStrokes() for(int i = 0; i < tabCount; i++) { int event = i < 9 ? KeyEvent.VK_1 + i : KeyEvent.VK_A + i - 9; - KeyStroke stroke = KeyStroke.getKeyStroke(event, InputEvent.CTRL_DOWN_MASK); + KeyStroke stroke = KeyStroke.getKeyStroke(event, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); final int index = i; AbstractAction action = new AbstractAction() { @@ -336,7 +326,7 @@ public static AppleJuiceDialog getApp() @SuppressWarnings("unchecked") private void init() throws Exception { - titel = "appleJuice Client (GUI " + AppleJuiceDialog.GUI_VERSION + "/" + ApplejuiceFassade.FASSADE_VERSION + ")"; + titel = "appleJuice GUI (" + AppleJuiceDialog.getVersion() + ")"; IconManager im = IconManager.getInstance(); firewallIcon = im.getIcon("firewall"); @@ -346,7 +336,6 @@ private void init() throws Exception Image image = im.getIcon("applejuice").getImage(); setTitle(titel); - String osName = System.getProperty("os.name"); setIconImage(image); menuItemOptionen.setIcon(im.getIcon("optionen")); @@ -445,11 +434,9 @@ public void componentMoved(ComponentEvent e) popup = makeSwingPopup(); try { - Class trayLoaderClass = Class.forName("de.applejuicenet.client.gui.tray.TrayLoader"); + TrayLoader trayLoader = new TrayLoader(); - trayLoader = (TrayIF) trayLoaderClass.newInstance(); - - useTrayIcon = trayLoader.makeTray(image, titel, this, popupShowHideMenuItem, zeigenIcon, versteckenIcon, popup); + useTrayIcon = trayLoader.makeTray(titel, this, popupShowHideMenuItem, zeigenIcon, versteckenIcon, popup); AppleJuiceClient.getAjFassade().addDataUpdateListener(new DataUpdateListener() { private Map<Integer, Integer> stati = new HashMap<Integer, Integer>(); @@ -501,13 +488,7 @@ else if(curDownload.getStatus() == Download.FERTIG && oldDownloadStatus != Downl } getContentPane().setLayout(new BorderLayout()); - linkPane.getBtnStartDownload().addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - uebernehmeLink(); - } - }); + linkPane.getBtnStartDownload().addActionListener(e -> uebernehmeLink()); getContentPane().add(linkPane, BorderLayout.NORTH); getContentPane().add(registerPane, BorderLayout.CENTER); @@ -523,25 +504,21 @@ public void actionPerformed(ActionEvent e) } memory.setIcon(IconManager.getInstance().getIcon("mmonitor")); - memory.addActionListener(new ActionListener() + memory.addActionListener(ae -> { + if(memoryMonitorDialog == null) { - public void actionPerformed(ActionEvent ae) - { - if(memoryMonitorDialog == null) - { - memoryMonitorDialog = new MemoryMonitorDialog(AppleJuiceDialog.this); - Point loc = memory.getLocationOnScreen(); + memoryMonitorDialog = new MemoryMonitorDialog(AppleJuiceDialog.this); + Point loc = memory.getLocationOnScreen(); - loc.setLocation(loc.getX() - memoryMonitorDialog.getWidth(), loc.getY() - memoryMonitorDialog.getHeight()); - memoryMonitorDialog.setLocation(loc); - } + loc.setLocation(loc.getX() - memoryMonitorDialog.getWidth(), loc.getY() - memoryMonitorDialog.getHeight()); + memoryMonitorDialog.setLocation(loc); + } - if(!memoryMonitorDialog.isVisible()) - { - memoryMonitorDialog.setVisible(true); - } - } - }); + if(!memoryMonitorDialog.isVisible()) + { + memoryMonitorDialog.setVisible(true); + } + }); sound.addActionListener(new ActionListener() { @@ -654,32 +631,27 @@ public void run() SoundPlayer.getInstance().playSound(SoundPlayer.LADEN); if(result.indexOf("ok") != 0) { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - String message = null; + SwingUtilities.invokeLater(() -> { + String message = null; - if(result.indexOf("already downloaded") != -1) - { - message = alreadyLoaded.replaceAll("%s", link); - } - else if(result.indexOf("incorrect link") != -1) - { - message = invalidLink.replaceAll("%s", link); - } - else if(result.indexOf("failure") != -1) - { - message = linkFailure; - } + if(result.contains("already downloaded")) + { + message = alreadyLoaded.replaceAll("%s", link); + } + else if(result.contains("incorrect link")) + { + message = invalidLink.replaceAll("%s", link); + } + else if(result.contains("failure")) + { + message = linkFailure; + } - if(message != null) - { - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), message, dialogTitel, - JOptionPane.OK_OPTION | JOptionPane.INFORMATION_MESSAGE); - } - } - }); + if(message != null) + { + JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), message, dialogTitel, JOptionPane.OK_OPTION | JOptionPane.INFORMATION_MESSAGE); + } + }); } } catch(IllegalArgumentException e) @@ -842,7 +814,7 @@ protected JMenuBar createMenuBar() for(int i = 0; i < tempListe.length; i++) { - if(tempListe[i].indexOf(".properties") != -1) + if(tempListe[i].contains(".properties")) { sprachDateien.add(tempListe[i]); } @@ -863,47 +835,19 @@ protected JMenuBar createMenuBar() JMenuBar menuBar = new JMenuBar(); optionenMenu = new JMenu(); - menuItemOptionen.addActionListener(new ActionListener() + menuItemOptionen.addActionListener(e -> showOptionsDialog()); + menuItemDateiliste.addActionListener(e -> dateiListeImportieren()); + menuItemCheckUpdate.addActionListener(e -> checkAndDisplayUpdate()); + menuItemCoreBeenden.addActionListener(e -> { + int result = JOptionPane.showConfirmDialog(AppleJuiceDialog.getApp(), bestaetigung, "appleJuice Client", + JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); + + if(result == JOptionPane.YES_OPTION) { - public void actionPerformed(ActionEvent e) - { - showOptionsDialog(); - } - }); - menuItemDateiliste.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dateiListeImportieren(); - } - }); - menuItemCheckUpdate.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - checkAndDisplayUpdate(); - } - }); - menuItemCoreBeenden.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - int result = JOptionPane.showConfirmDialog(AppleJuiceDialog.getApp(), bestaetigung, "appleJuice Client", - JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); - - if(result == JOptionPane.YES_OPTION) - { - AppleJuiceClient.getAjFassade().shutdownCore(); - } - } - }); - menuItemUeber.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - showAboutDialog(); - } - }); + AppleJuiceClient.getAjFassade().shutdownCore(); + } + }); + menuItemUeber.addActionListener(e -> showAboutDialog()); optionenMenu.add(menuItemOptionen); optionenMenu.add(menuItemDateiliste); optionenMenu.add(menuItemCheckUpdate); @@ -932,21 +876,17 @@ public void actionPerformed(ActionEvent e) rb.setIcon(result); sprachMenu.add(rb); - rb.addItemListener(new ItemListener() - { - public void itemStateChanged(ItemEvent ae) - { - JCheckBoxMenuItem rb2 = (JCheckBoxMenuItem) ae.getSource(); + rb.addItemListener(ae -> { + JCheckBoxMenuItem rb2 = (JCheckBoxMenuItem) ae.getSource(); - if(rb2.isSelected()) - { - String path = System.getProperty("user.dir") + File.separator + "language" + File.separator; - String dateiName = path + rb2.getText().toLowerCase() + ".properties"; + if(rb2.isSelected()) + { + String path1 = System.getProperty("user.dir") + File.separator + "language" + File.separator; + String dateiName = path1 + rb2.getText().toLowerCase() + ".properties"; - LanguageSelector.getInstance(dateiName); - } - } - }); + LanguageSelector.getInstance(dateiName); + } + }); lafGroup.add(rb); } @@ -972,7 +912,7 @@ public void itemStateChanged(ItemEvent ae) for(int i = 0; i < themeFiles.length; i++) { - if(themeFiles[i].isFile() && themeFiles[i].getName().indexOf(".zip") != -1) + if(themeFiles[i].isFile() && themeFiles[i].getName().endsWith(".zip")) { //testen, ob es wirklich ein skinfile ist @@ -1010,28 +950,18 @@ public void itemStateChanged(ItemEvent ae) rb.setSelected(true); } - rb.addItemListener(new ItemListener() + rb.addItemListener(ae -> { + if(rb.isSelected()) { - public void itemStateChanged(ItemEvent ae) - { - if(rb.isSelected()) - { - activateLaF(rb.getText()); - } - } - }); + activateLaF(rb.getText()); + } + }); lafGroup2.add(rb); themesMenu.add(rb); } themesMenu.add(new JSeparator()); - menuItemDeaktivieren.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ce) - { - activateThemeSupport(false); - } - }); + menuItemDeaktivieren.addActionListener(ce -> activateThemeSupport(false)); themesMenu.add(menuItemDeaktivieren); } else @@ -1055,25 +985,15 @@ public void actionPerformed(ActionEvent ce) lookAndFeelMenuItem.setSelected(false); } - lookAndFeelMenuItem.addItemListener(new ItemListener() + lookAndFeelMenuItem.addItemListener(ae -> { + if(lookAndFeelMenuItem.isSelected()) { - public void itemStateChanged(ItemEvent ae) - { - if(lookAndFeelMenuItem.isSelected()) - { - activateLaF(lookAndFeelMenuItem.getText()); - } - } - }); - } - - menuItemAktivieren.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ce) - { - activateThemeSupport(true); + activateLaF(lookAndFeelMenuItem.getText()); } }); + } + + menuItemAktivieren.addActionListener(ce -> activateThemeSupport(true)); themesMenu.add(new JSeparator()); themesMenu.add(menuItemAktivieren); } @@ -1268,17 +1188,17 @@ public void run() returnValues.append("'" + link + "' OK\n"); somethingAdded = true; } - else if(result.indexOf("already downloaded") != -1) + else if(result.contains("already downloaded")) { returnValues.append(alreadyLoaded.replaceAll("%s", link) + "\n"); somethingAdded = true; } - else if(result.indexOf("incorrect link") != -1) + else if(result.contains("incorrect link")) { returnValues.append(invalidLink.replaceAll("%s", link) + "\n"); somethingAdded = true; } - else if(result.indexOf("failure") != -1) + else if(result.contains("failure")) { returnValues.append(linkFailure + "\n"); somethingAdded = true; @@ -1288,22 +1208,18 @@ else if(result.indexOf("failure") != -1) if(somethingAdded) { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - JTextPane textArea = new JTextPane(); - - textArea.setPreferredSize(new Dimension(550, 300)); - textArea.setMaximumSize(new Dimension(550, 300)); - textArea.setEditable(false); - textArea.setBackground(new TKLLabel().getBackground()); - textArea.setText(returnValues.toString()); - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), new JScrollPane(textArea), - dialogTitel, - JOptionPane.OK_OPTION | JOptionPane.INFORMATION_MESSAGE); - } - }); + SwingUtilities.invokeLater(() -> { + JTextPane textArea = new JTextPane(); + + textArea.setPreferredSize(new Dimension(550, 300)); + textArea.setMaximumSize(new Dimension(550, 300)); + textArea.setEditable(false); + textArea.setBackground(new TKLLabel().getBackground()); + textArea.setText(returnValues.toString()); + JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), new JScrollPane(textArea), + dialogTitel, + JOptionPane.OK_OPTION | JOptionPane.INFORMATION_MESSAGE); + }); } } catch(FileNotFoundException ex) @@ -1383,93 +1299,72 @@ public void fireContentChanged(DATALISTENER_TYPE type, final Object content) { if(type == DATALISTENER_TYPE.NETINFO_CHANGED) { - SwingUtilities.invokeLater(new Runnable() + SwingUtilities.invokeLater(() -> { + try { - public void run() + NetworkInfo netInfo = (NetworkInfo) content; + + if(netInfo.isFirewalled() != firewalled) { - try + firewalled = !firewalled; + updateFirewall(); + if(firewalled) { - NetworkInfo netInfo = (NetworkInfo) content; - - if(netInfo.isFirewalled() != firewalled) - { - firewalled = !firewalled; - updateFirewall(); - if(firewalled) - { - statusbar[0].setToolTipText(firewallWarning); - } - else - { - statusbar[0].setToolTipText(null); - } - - updateFirewall(); - } + statusbar[0].setToolTipText(firewallWarning); } - catch(Exception e) + else { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); + statusbar[0].setToolTipText(null); } + + updateFirewall(); } - }); + } + catch(Exception e) + { + logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); + } + }); } else if(type == DATALISTENER_TYPE.INFORMATION_CHANGED) { - SwingUtilities.invokeLater(new Runnable() + SwingUtilities.invokeLater(() -> { + try { - public void run() + information = (Information) content; + statusbar[0].setText(getVerbindungsStatusAsString(information)); + if(information.getVerbindungsStatus() == Information.NICHT_VERBUNDEN) + { + statusbar[1].setText(keinServer); + } + else { - try + String tmp = information.getServerName(); + + if(tmp == null || tmp.length() == 0) { - if(firstChange) - { - firstChange = false; - SoundPlayer.getInstance().playSound(SoundPlayer.GESTARTET); - String versionsNr = AppleJuiceClient.getAjFassade().getCoreVersion().getVersion(); - - titel = LanguageSelector.getInstance().getFirstAttrbuteByTagName("mainform.caption") + " (Core " + - versionsNr + " - GUI " + AppleJuiceDialog.GUI_VERSION + "/" + ApplejuiceFassade.FASSADE_VERSION + - ")"; - setTitle(titel); - repaint(); - } + Server server = information.getServer(); - information = (Information) content; - statusbar[0].setText(getVerbindungsStatusAsString(information)); - if(information.getVerbindungsStatus() == Information.NICHT_VERBUNDEN) + if(server != null) { - statusbar[1].setText(keinServer); + tmp = server.getHost() + ":" + server.getPort(); } - else - { - String tmp = information.getServerName(); - - if(tmp == null || tmp.length() == 0) - { - Server server = information.getServer(); - - if(server != null) - { - tmp = server.getHost() + ":" + server.getPort(); - } - } - - statusbar[1].setText(tmp); - } - - statusbar[2].setText(information.getUpDownAsString()); - statusbar[3].setText(information.getUpDownSessionAsString()); - statusbar[4].setText(information.getExterneIP()); - statusbar[5].setText(information.getCreditsAsString()); - updateFirewall(); - } - catch(Exception e) - { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); } + + statusbar[1].setText(tmp); } - }); + + statusbar[2].setText(information.getUpDownAsString()); + statusbar[3].setText(information.getUpDownSessionAsString()); + statusbar[4].setText(information.getExterneIP()); + statusbar[5].setText(information.getCreditsAsString()); + updateFirewall(); + } + catch(Exception e) + { + logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); + } + }); } } @@ -1496,36 +1391,26 @@ public JPopupMenu makeSwingPopup() { final JPopupMenu popup = new JPopupMenu(); - popupShowHideMenuItem.addActionListener(new ActionListener() + popupShowHideMenuItem.addActionListener(ae -> { + if(!isVisible()) { - public void actionPerformed(ActionEvent ae) - { - if(!isVisible()) - { - setVisible(true); - setAlwaysOnTop(true); - setAlwaysOnTop(false); - requestFocus(); - } - else - { - if(popup.isVisible()) - { - popup.setVisible(false); - } - - setVisible(false); - } - } - }); - popup.add(popupShowHideMenuItem); - popupOptionenMenuItem.addActionListener(new ActionListener() + setVisible(true); + setAlwaysOnTop(true); + setAlwaysOnTop(false); + requestFocus(); + } + else { - public void actionPerformed(ActionEvent ae) + if(popup.isVisible()) { - showOptionsDialog(); + popup.setVisible(false); } - }); + + setVisible(false); + } + }); + popup.add(popupShowHideMenuItem); + popupOptionenMenuItem.addActionListener(ae -> showOptionsDialog()); popup.add(popupOptionenMenuItem); IconManager im = IconManager.getInstance(); @@ -1536,13 +1421,7 @@ public void actionPerformed(ActionEvent ae) popupOptionenMenuItem.setIcon(im.getIcon("optionen")); popupAboutMenuItem.setIcon(aboutIcon); - popupAboutMenuItem.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - showAboutDialog(); - } - }); + popupAboutMenuItem.addActionListener(ae -> showAboutDialog()); popup.add(popupAboutMenuItem); new Thread() { @@ -1585,40 +1464,32 @@ public void run() final TKLLabel label1 = new TKLLabel("50 kb/s"); final TKLLabel label2 = new TKLLabel("50 kb/s"); - label1.setText(Long.toString(ajSettings.getMaxUploadInKB()) + " kb/s"); - label2.setText(Long.toString(ajSettings.getMaxDownloadInKB()) + " kb/s"); + label1.setText(ajSettings.getMaxUploadInKB() + " kb/s"); + label2.setText(ajSettings.getMaxDownloadInKB() + " kb/s"); uploadPanel.add(label1, BorderLayout.NORTH); uploadPanel.add(uploadSlider, BorderLayout.SOUTH); uploadMenu.add(uploadPanel); downloadPanel.add(label2, BorderLayout.NORTH); downloadPanel.add(downloadSlider, BorderLayout.SOUTH); downloadMenu.add(downloadPanel); - uploadSlider.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - JSlider slider = (JSlider) e.getSource(); + uploadSlider.addChangeListener(e -> { + JSlider slider = (JSlider) e.getSource(); - label1.setText(Integer.toString(slider.getValue()) + " kb/s"); - } - }); - downloadSlider.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - JSlider slider = (JSlider) e.getSource(); + label1.setText(slider.getValue() + " kb/s"); + }); + downloadSlider.addChangeListener(e -> { + JSlider slider = (JSlider) e.getSource(); - label2.setText(Integer.toString(slider.getValue()) + " kb/s"); - } - }); + label2.setText(slider.getValue() + " kb/s"); + }); uploadSlider.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent e) { if(uploadSlider.getValue() < uploadSlider.getMaximum() && uploadSlider.getValue() > 0) { - Long down = new Long(downloadSlider.getValue() * 1024); - Long up = new Long(uploadSlider.getValue() * 1024); + Long down = (long) (downloadSlider.getValue() * 1024); + Long up = (long) (uploadSlider.getValue() * 1024); try { @@ -1641,8 +1512,8 @@ public void mouseReleased(MouseEvent e) { if(downloadSlider.getValue() < downloadSlider.getMaximum() && downloadSlider.getValue() > 0) { - Long down = new Long(downloadSlider.getValue() * 1024); - Long up = new Long(uploadSlider.getValue() * 1024); + Long down = (long) (downloadSlider.getValue() * 1024); + Long up = (long) (uploadSlider.getValue() * 1024); try { @@ -1659,14 +1530,10 @@ public void mouseReleased(MouseEvent e) } } }); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - popup.add(uploadMenu); - popup.add(downloadMenu); - } - }); + SwingUtilities.invokeLater(() -> { + popup.add(uploadMenu); + popup.add(downloadMenu); + }); } } }.start(); @@ -1699,93 +1566,7 @@ private String getVerbindungsStatusAsString(Information information) private void checkAndDisplayUpdate() { - Thread versionWorker = new Thread() - { - public void run() - { - if(logger.isEnabledFor(Level.DEBUG)) - { - logger.debug("VersionWorkerThread gestartet. " + this); - } - - try - { - ProxySettings proxy = ProxyManagerImpl.getInstance().getProxySettings(); - String downloadData = WebsiteContentLoader.getWebsiteContent(proxy, "http://www.tkl-soft.de", 80, - "/applejuice/version.txt"); - - if(downloadData.length() > 0) - { - int pos1 = downloadData.indexOf("|"); - String aktuellsteVersion = downloadData.substring(0, pos1); - StringTokenizer token1 = new StringTokenizer(aktuellsteVersion, "."); - String guiVersion = AppleJuiceDialog.GUI_VERSION; - - if(guiVersion.indexOf('-') != -1) - { - guiVersion = guiVersion.substring(0, guiVersion.indexOf('-')); - } - - StringTokenizer token2 = new StringTokenizer(guiVersion, "."); - - if(token1.countTokens() != 3 || token2.countTokens() != 3) - { - return; - } - - String[] versionInternet = new String[3]; - String[] aktuelleVersion = new String[3]; - - for(int i = 0; i < 3; i++) - { - versionInternet[i] = token1.nextToken(); - aktuelleVersion[i] = token2.nextToken(); - } - - if((versionInternet[0].compareTo(aktuelleVersion[0]) > 0) || - (versionInternet[0].compareTo(aktuelleVersion[0]) == 0 && - versionInternet[1].compareTo(aktuelleVersion[1]) > 0) || - (versionInternet[0].compareTo(aktuelleVersion[0]) == 0 && - versionInternet[1].compareTo(aktuelleVersion[1]) == 0) && - versionInternet[2].compareTo(aktuelleVersion[2]) > 0) - { - int pos2 = downloadData.lastIndexOf("|"); - String winLink = downloadData.substring(pos1 + 1, pos2); - String sonstigeLink = downloadData.substring(pos2 + 1); - UpdateInformationDialog updateInformationDialog = new UpdateInformationDialog(AppleJuiceDialog.getApp(), - aktuellsteVersion, winLink, - sonstigeLink); - - updateInformationDialog.setVisible(true); - } - else - { - LanguageSelector languageSelector = LanguageSelector.getInstance(); - String fehlerTitel = languageSelector.getFirstAttrbuteByTagName("mainform.caption"); - - String fehlerNachricht = languageSelector.getFirstAttrbuteByTagName("javagui.checkupdate.keineNeueVersion"); - - JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), fehlerNachricht, fehlerTitel, - JOptionPane.INFORMATION_MESSAGE); - } - } - } - catch(Exception e) - { - if(logger.isEnabledFor(Level.INFO)) - { - logger.info("Aktualisierungsinformationen konnten nicht geladen werden. Server down?"); - } - } - - if(logger.isEnabledFor(Level.DEBUG)) - { - logger.debug("VersionWorkerThread beendet. " + this); - } - } - }; - - versionWorker.start(); + VersionChecker.check(); } public void informWrongPassword() @@ -1828,24 +1609,20 @@ public JCheckBoxLookAndFeelMenuItem(LookAFeel lookAFeelToUse) { super(lookAFeelToUse.getName()); this.lookAFeel = lookAFeelToUse; - addItemListener(new ItemListener() + addItemListener(ae -> { + if(isSelected()) { - public void itemStateChanged(ItemEvent ae) + try { - if(isSelected()) - { - try - { - UIManager.setLookAndFeel(lookAFeel.getClassName()); - SwingUtilities.updateComponentTreeUI(AppleJuiceDialog.this); - } - catch(Exception ex) - { - logger.error(ApplejuiceFassade.ERROR_MESSAGE, ex); - } - } + UIManager.setLookAndFeel(lookAFeel.getClassName()); + SwingUtilities.updateComponentTreeUI(AppleJuiceDialog.this); } - }); + catch(Exception ex) + { + logger.error(ApplejuiceFassade.ERROR_MESSAGE, ex); + } + } + }); } } } diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/DownloadlinkPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/DownloadlinkPanel.java similarity index 65% rename from AJClientGUI/src/de/applejuicenet/client/gui/DownloadlinkPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/DownloadlinkPanel.java index c252a2bd..7f572454 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/DownloadlinkPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/DownloadlinkPanel.java @@ -10,9 +10,8 @@ import java.io.File; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JPanel; +import javax.swing.*; +import javax.swing.text.DefaultEditorKit; import de.applejuicenet.client.fassade.ApplejuiceFassade; import de.applejuicenet.client.gui.controller.LanguageSelector; @@ -38,7 +37,7 @@ public DownloadlinkPanel() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[][] sizes = + double[][] sizes = { {5, p, 5, f, 5, p, 5}, {5, p} @@ -56,82 +55,71 @@ public void keyPressed(KeyEvent ke) }; txtDownloadLink.addKeyListener(keyListener); - InvalidRule downloadloadlinkRule = new InvalidRule() - { - public boolean isInvalid(ModifyableComponent component) - { - String text = ((TKLTextField) component).getText().toLowerCase(); - - if(text.length() == 0) - { - return false; - } + InvalidRule downloadloadlinkRule = component -> { + String text = ((TKLTextField) component).getText().toLowerCase(); - if(!text.startsWith("ajfsp://")) - { - return true; - } + if(text.length() == 0) + { + return false; + } - text = text.substring("ajfsp://".length()); - if(!text.startsWith("file") && !text.startsWith("server")) - { - return true; - } + if(!text.startsWith("ajfsp://")) + { + return true; + } - int count; + text = text.substring("ajfsp://".length()); + if(!text.startsWith("file") && !text.startsWith("server")) + { + return true; + } - if(text.startsWith("file")) - { - count = 3; - } - else - { - count = 2; - } + int count; - for(int i = 0; i < text.length(); i++) - { - if(text.charAt(i) == '|') - { - count--; - } - } + if(text.startsWith("file")) + { + count = 3; + } + else + { + count = 2; + } - if(count > 0) + for(int i = 0; i < text.length(); i++) + { + if(text.charAt(i) == '|') { - return true; + count--; } + } - return false; + if(count > 0) + { + return true; } + + return false; }; txtDownloadLink.ignoreStatus(STATUSFLAG.MODIFIED, true); txtDownloadLink.addInvalidRule(downloadloadlinkRule); txtDownloadLink.ignoreInvalidRules(false); - cmbTargetDir.ignoreStatus(STATUSFLAG.MODIFIED, true); - InvalidRule targetDirRule = new InvalidRule() - { - public boolean isInvalid(ModifyableComponent component) - { - Object obj = ((TKLComboBox) component).getSelectedItem(); - - if(obj == null) - { - return false; - } - - String subdir = (String) obj; +// txtDownloadLink.getComponentPopupMenu().add( new JMenuItem(new DefaultEditorKit.CopyAction()) ); - if(subdir.indexOf(File.separator) != -1 || subdir.indexOf(ApplejuiceFassade.separator) != -1 || - subdir.indexOf("..") != -1 || subdir.indexOf(":") != -1) - { - return true; - } + cmbTargetDir.ignoreStatus(STATUSFLAG.MODIFIED, true); + InvalidRule targetDirRule = component -> { + Object obj = ((TKLComboBox) component).getSelectedItem(); + if(obj == null) + { return false; } + + String subdir = (String) obj; + + return subdir.contains(File.separator) || subdir.indexOf(ApplejuiceFassade.separator) != -1 || + subdir.contains("..") || subdir.contains(":"); }; cmbTargetDir.addInvalidRule(targetDirRule); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/RegisterI.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/RegisterI.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/RegisterI.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/RegisterI.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/RegisterPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/RegisterPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/RegisterPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/RegisterPanel.java diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/UpdateInformationDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/UpdateInformationDialog.java new file mode 100644 index 00000000..4aaccf8b --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/UpdateInformationDialog.java @@ -0,0 +1,154 @@ +/* + * Copyright 2006 TKLSoft.de All rights reserved. + */ + +package de.applejuicenet.client.gui; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import de.applejuicenet.client.fassade.ApplejuiceFassade; +import de.applejuicenet.client.gui.controller.LanguageSelector; +import de.applejuicenet.client.gui.controller.OptionsManagerImpl; + +/** + * <p>Titel: AppleJuice Client-GUI</p> + * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> + * <p>Copyright: General Public License</p> + * + * @author Maj0r <aj@tkl-soft.de> + */ +public class UpdateInformationDialog extends JDialog { + private String aktuellsteVersion; + private final JButton schliessen = new JButton(); + private String releaseLink = ""; + private final Logger logger; + + public UpdateInformationDialog(JFrame parentFrame, String aktuellsteVersion, String releaseLink) { + super(parentFrame, true); + logger = Logger.getLogger(getClass()); + try { + this.aktuellsteVersion = aktuellsteVersion; + this.releaseLink = releaseLink; + init(); + } catch (Exception e) { + if (logger.isEnabledFor(Level.ERROR)) { + logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); + } + } + } + + private void init() { + LanguageSelector ls = LanguageSelector.getInstance(); + + schliessen.addActionListener(ae -> UpdateInformationDialog.this.dispose()); + + String titel = ls.getFirstAttrbuteByTagName("javagui.startup.newversiontitel"); + String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.newversionnachricht"); + + nachricht = nachricht.replaceFirst("%s", aktuellsteVersion); + schliessen.setText(ls.getFirstAttrbuteByTagName("javagui.options.plugins.schliessen")); + setTitle(titel); + JPanel panel1 = new JPanel(new GridBagLayout()); + GridBagConstraints constraints = new GridBagConstraints(); + + constraints.anchor = GridBagConstraints.NORTH; + constraints.fill = GridBagConstraints.BOTH; + constraints.gridx = 0; + constraints.gridy = 0; + constraints.gridwidth = 3; + constraints.insets.left = 5; + constraints.insets.top = 5; + constraints.insets.right = 5; + panel1.add(new JLabel(nachricht), constraints); + constraints.insets.right = 0; + constraints.gridwidth = 1; + constraints.gridy = 1; + JLabel label1 = new JLabel(); + + label1.setText(ls.getFirstAttrbuteByTagName("javagui.startup.newversion") + ": "); + JLabel linkWin = new JLabel("<html><font><u>" + releaseLink + "</u></font></html>"); + + panel1.add(label1, constraints); + constraints.gridx = 1; + panel1.add(linkWin, constraints); + constraints.gridx = 2; + constraints.weightx = 1; + constraints.insets.right = 5; + panel1.add(new JLabel(), constraints); + constraints.insets.right = 0; + constraints.weightx = 0; + constraints.gridx = 0; + constraints.gridy = 2; + constraints.insets.bottom = 5; + + linkWin.setForeground(Color.blue); + linkWin.addMouseListener(new MouseAdapter() { + public void mouseExited(MouseEvent e) { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + + public void mouseEntered(MouseEvent e) { + setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + + public void mouseClicked(MouseEvent e) { + executeLink(releaseLink); + } + }); + + getContentPane().setLayout(new BorderLayout()); + getContentPane().add(panel1, BorderLayout.CENTER); + JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + + southPanel.add(schliessen); + getContentPane().add(southPanel, BorderLayout.SOUTH); + pack(); + Dimension appDimension = getSize(); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + setLocation((screenSize.width - appDimension.width) / 2, (screenSize.height - appDimension.height) / 2); + } + + private void executeLink(String link) { + try { + String browser = OptionsManagerImpl.getInstance().getStandardBrowser(); + + try { + Runtime.getRuntime().exec(new String[]{browser, link}); + } catch (Exception ex) { + LanguageSelector ls = LanguageSelector.getInstance(); + String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.updatefehlernachricht"); + String titel = ls.getFirstAttrbuteByTagName("mainform.caption"); + + setVisible(false); + JOptionPane.showMessageDialog(this, nachricht, titel, JOptionPane.INFORMATION_MESSAGE); + setVisible(true); + } + } catch (Exception e) { + if (logger.isEnabledFor(Level.ERROR)) { + logger.error(ApplejuiceFassade.ERROR_MESSAGE, e); + } + } + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/VersionChecker.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/VersionChecker.java new file mode 100644 index 00000000..798dc9cc --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/VersionChecker.java @@ -0,0 +1,92 @@ +package de.applejuicenet.client.gui; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import de.applejuicenet.client.fassade.shared.ProxySettings; +import de.applejuicenet.client.fassade.shared.WebsiteContentLoader; +import de.applejuicenet.client.gui.controller.ProxyManagerImpl; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import javax.swing.*; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class VersionChecker { + + private static final Logger logger = Logger.getLogger(AppleJuiceDialog.class); + + public static void check() { + Thread versionWorker = new Thread() { + public void run() { + if (logger.isEnabledFor(Level.DEBUG)) { + logger.debug("VersionWorkerThread gestartet. " + this); + } + + try { + ProxySettings proxy = ProxyManagerImpl.getInstance().getProxySettings(); + String downloadData = WebsiteContentLoader.getWebsiteContent(proxy, "https://api.github.com", 443, "/repos/applejuicenet/gui-java/releases/latest"); + + if (downloadData.length() > 0) { + JsonObject jsonObject = new JsonParser().parse(downloadData).getAsJsonObject(); + String aktuellsteVersion = jsonObject.get("tag_name").getAsString(); + + if (logger.isEnabledFor(Level.INFO)) { + logger.info("letzte veröffentlichte Version: " + aktuellsteVersion); + } + + if (compareVersion(aktuellsteVersion, AppleJuiceDialog.getVersion()) == 1) { + String releaseLink = jsonObject.get("html_url").getAsString(); + SwingUtilities.invokeLater(() -> { + UpdateInformationDialog updateInformationDialog = new UpdateInformationDialog(AppleJuiceDialog.getApp(), aktuellsteVersion, releaseLink); + updateInformationDialog.setVisible(true); + }); + } else { + if (logger.isEnabledFor(Level.INFO)) { + logger.info("aktuelle Version " + AppleJuiceDialog.getVersion() + " | letzte veröffentlichte Version: " + aktuellsteVersion); + } + } + + } + } catch (Exception e) { + if (logger.isEnabledFor(Level.INFO)) { + logger.info("Aktualisierungsinformationen konnten nicht geladen werden."); + } + } + + if (logger.isEnabledFor(Level.DEBUG)) { + logger.debug("VersionWorkerThread beendet. " + this); + } + } + }; + + versionWorker.start(); + } + + public static int compareVersion(String A, String B) { + List<String> strList1 = Arrays.stream(A.split("\\.")) + .map(s -> s.replaceAll("^0+(?!$)", "")) + .collect(Collectors.toList()); + List<String> strList2 = Arrays.stream(B.split("\\.")) + .map(s -> s.replaceAll("^0+(?!$)", "")) + .collect(Collectors.toList()); + int len1 = strList1.size(); + int len2 = strList2.size(); + int i = 0; + while (i < len1 && i < len2) { + if (strList1.get(i).length() > strList2.get(i).length()) return 1; + if (strList1.get(i).length() < strList2.get(i).length()) return -1; + int result = new Long(strList1.get(i)).compareTo(new Long(strList2.get(i))); + if (result != 0) return result; + i++; + } + while (i < len1) { + if (!strList1.get(i++).equals("0")) return 1; + } + while (i < len2) { + if (!strList2.get(i++).equals("0")) return -1; + } + return 0; + } +} diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/about/AboutDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/about/AboutDialog.java similarity index 97% rename from AJClientGUI/src/de/applejuicenet/client/gui/about/AboutDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/about/AboutDialog.java index 0d0c0f58..31a68aa4 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/about/AboutDialog.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/about/AboutDialog.java @@ -142,16 +142,16 @@ private void init() credits.add(new CreditsEntry(false, "(tkrall@tkl-soft.de)")); credits.add(new CreditsEntry(false, "loevenwong")); credits.add(new CreditsEntry(false, "(tloevenich@tkl-soft.de)")); + credits.add(new CreditsEntry(false, "red171")); + credits.add(new CreditsEntry(false, "(red171@tr4sh.eu)")); credits.add(new CreditsEntry(true, "Besonderen Dank an")); credits.add(new CreditsEntry(false, "muhviehstarr")); credits.add(new CreditsEntry(true, "Banner & Bilder")); credits.add(new CreditsEntry(false, "saschxd")); - credits.add(new CreditsEntry(true, "bersetzung")); + credits.add(new CreditsEntry(true, "Übersetzung")); credits.add(new CreditsEntry(false, "BlueTiger")); credits.add(new CreditsEntry(false, "nurseppel")); credits.add(new CreditsEntry(true, "Kontakt")); - credits.add(new CreditsEntry(false, "irc.devStaff.net:6667")); - credits.add(new CreditsEntry(false, "#applejuice")); credits.add(new CreditsEntry(false, "www.applejuicenet.de")); backgroundImage = IconManager.getInstance().getIcon("applejuiceinfobanner").getImage(); @@ -169,7 +169,7 @@ private void init() //kein Bild da, dann kack drauf ;-) } - version.setText("Version " + AppleJuiceDialog.GUI_VERSION + "/" + ApplejuiceFassade.FASSADE_VERSION); + version.setText("Version " + AppleJuiceDialog.getVersion()); Font font = version.getFont(); font = new Font(font.getName(), Font.PLAIN, font.getSize()); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/GuiController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/GuiController.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/GuiController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/GuiController.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/GuiControllerActionListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/GuiControllerActionListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/GuiControllerActionListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/GuiControllerActionListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/TklPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/TklPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/TklPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/TklPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/dragndrop/DndSourceAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/dragndrop/DndSourceAdapter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/dragndrop/DndSourceAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/dragndrop/DndSourceAdapter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/dragndrop/DndTargetAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/dragndrop/DndTargetAdapter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/dragndrop/DndTargetAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/dragndrop/DndTargetAdapter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/listener/KeyStates.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/listener/KeyStates.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/listener/KeyStates.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/listener/KeyStates.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/BevelArrowIcon.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/BevelArrowIcon.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/BevelArrowIcon.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/BevelArrowIcon.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/BlankIcon.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/BlankIcon.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/BlankIcon.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/BlankIcon.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/HeaderListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/HeaderListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/HeaderListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/HeaderListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/NormalHeaderRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/NormalHeaderRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/NormalHeaderRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/NormalHeaderRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/SortButtonRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/SortButtonRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/SortButtonRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/SortButtonRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/SortableTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/SortableTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/SortableTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/SortableTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/table/TableSorter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/TableSorter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/table/TableSorter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/table/TableSorter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/tree/ApplejuiceNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/tree/ApplejuiceNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/tree/ApplejuiceNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/tree/ApplejuiceNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/tree/WaitNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/tree/WaitNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/tree/WaitNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/tree/WaitNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/AbstractCellEditor.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/AbstractCellEditor.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/AbstractCellEditor.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/AbstractCellEditor.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/AbstractTreeTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/AbstractTreeTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/AbstractTreeTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/AbstractTreeTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/DefaultIconNodeRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/DefaultIconNodeRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/DefaultIconNodeRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/DefaultIconNodeRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/DefaultTreeTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/DefaultTreeTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/DefaultTreeTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/DefaultTreeTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/JTreeTable.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/JTreeTable.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/JTreeTable.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/JTreeTable.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/Node.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/Node.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/Node.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/Node.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/TreeTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/TreeTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/TreeTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/TreeTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/TreeTableModelAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/TreeTableModelAdapter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/treetable/TreeTableModelAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/treetable/TreeTableModelAdapter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/util/IconGetter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/IconGetter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/util/IconGetter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/IconGetter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/util/MergeSort.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/MergeSort.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/util/MergeSort.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/MergeSort.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/components/util/Value.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/Value.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/components/util/Value.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/components/util/Value.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/connect/ConnectFrame.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/connect/ConnectFrame.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/connect/ConnectFrame.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/connect/ConnectFrame.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/connect/QuickConnectionSettingsDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/connect/QuickConnectionSettingsDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/connect/QuickConnectionSettingsDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/connect/QuickConnectionSettingsDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/LanguageSelector.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/LanguageSelector.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/LanguageSelector.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/LanguageSelector.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/LinkListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/LinkListener.java similarity index 98% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/LinkListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/LinkListener.java index b09769b8..0878069e 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/controller/LinkListener.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/LinkListener.java @@ -79,9 +79,10 @@ public void run() BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String line = reader.readLine(); - if(line.indexOf("-link=") != -1) + if(line.contains("-link=")) { String link = getLinkFromReadLine(line); + link = link.replaceAll("%7C", "|"); if(link != null) { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManager.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManager.java similarity index 96% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManager.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManager.java index 9f8aa159..07305ed6 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManager.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManager.java @@ -31,9 +31,9 @@ public interface OptionsManager String getSprache(); - int getVersionsinfoModus(); + boolean getUpdateInfo(); - void setVersionsinfoModus(int versionsinfoModus); + void setUpdateInfo(boolean UpdateInfo); boolean isErsterStart(); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java similarity index 95% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java index b7b7d3df..5621373e 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/OptionsManagerImpl.java @@ -47,12 +47,12 @@ public String getSprache() { return propertiesManager.getSprache(); } - public int getVersionsinfoModus() { - return propertiesManager.getVersionsinfoModus(); + public boolean getUpdateInfo() { + return propertiesManager.getUpdateInfo(); } - public void setVersionsinfoModus(int versionsInfoModus) { - propertiesManager.setVersionsinfoModus(versionsInfoModus); + public void setUpdateInfo(boolean UpdateInfo) { + propertiesManager.setUpdateInfo(UpdateInfo); } public boolean isErsterStart() { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/PositionManager.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PositionManager.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/PositionManager.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PositionManager.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/PositionManagerImpl.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PositionManagerImpl.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/PositionManagerImpl.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PositionManagerImpl.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/PropertiesManager.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PropertiesManager.java similarity index 99% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/PropertiesManager.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PropertiesManager.java index 61cb536a..bb898e4f 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/controller/PropertiesManager.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PropertiesManager.java @@ -436,7 +436,7 @@ public String getStandardBrowser() { try { - return propertyHandler.get("options_browser_file", ""); + return propertyHandler.get("options_browser_file", "xdg-open"); } catch(Exception e) { @@ -536,19 +536,14 @@ public void enableThemeSupport(boolean enable) propertyHandler.put("options_themes", enable); } - public int getVersionsinfoModus() + public boolean getUpdateInfo() { - return propertyHandler.getAsInt("options_versionsinfo", 1); + return propertyHandler.getAsBoolean("options_updateinfo", true); } - public void setVersionsinfoModus(int versionsinfoModus) + public void setUpdateInfo(boolean UpdateInfo) { - if(versionsinfoModus < 0 || versionsinfoModus > 2) - { - versionsinfoModus = 1; - } - - propertyHandler.put("options_versionsinfo", versionsinfoModus); + propertyHandler.put("options_updateinfo", UpdateInfo); } public int getLinkListenerPort() @@ -886,7 +881,7 @@ public static void restoreProperties() aPropertyHandler.put("options_loadplugins", true); aPropertyHandler.put("options_enableToolTip", true); aPropertyHandler.put("options_linklistenerport", 8768); - aPropertyHandler.put("options_versionsinfo", 1); + aPropertyHandler.put("options_updateinfo", true); aPropertyHandler.put("options_remote_host", "localhost"); aPropertyHandler.put("options_remote_passwort", ""); aPropertyHandler.put("options_remote_port", 9851); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/PropertyHandler.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PropertyHandler.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/PropertyHandler.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/PropertyHandler.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/ProxyManager.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/ProxyManager.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/ProxyManager.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/ProxyManager.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/controller/ProxyManagerImpl.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/ProxyManagerImpl.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/controller/ProxyManagerImpl.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/controller/ProxyManagerImpl.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/debug/DebugController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/DebugController.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/debug/DebugController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/DebugController.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/debug/DebugPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/DebugPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/debug/DebugPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/DebugPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/debug/LiveAppender.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/LiveAppender.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/debug/LiveAppender.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/debug/LiveAppender.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadController.java similarity index 99% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadController.java index 99cae83b..33243cb5 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadController.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadController.java @@ -28,6 +28,7 @@ import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; +import de.applejuicenet.client.shared.ReleaseInfo; import org.apache.log4j.Level; import de.applejuicenet.client.AppleJuiceClient; @@ -54,7 +55,6 @@ import de.applejuicenet.client.gui.upload.HeaderPopupListener; import de.applejuicenet.client.gui.upload.UploadMouseMotionListener; import de.applejuicenet.client.shared.DesktopTools; -import de.applejuicenet.client.shared.ReleaseInfoDialog; import de.applejuicenet.client.shared.SoundPlayer; public class DownloadController extends GuiController @@ -378,7 +378,7 @@ private void showReleaseInfo() Download curDownload = selectedItems[0]; - ReleaseInfoDialog.showReleaseInfo(curDownload.getHash()); + ReleaseInfo.handle(curDownload.getFilename(), curDownload.getHash(), (long) curDownload.getGroesse()); } private void headerDownloadsDragged() diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadOverviewPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadOverviewPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadOverviewPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadOverviewPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPanel.java similarity index 85% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPanel.java index 138e2925..bf7f2da5 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPanel.java @@ -352,41 +352,35 @@ public void internalSort(int column, boolean ascent) columnDownloadPopupItems[i] = new JCheckBoxMenuItem((String) downloadColumns[i].getHeaderValue()); final int x = i; - columnDownloadPopupItems[i].addActionListener(new ActionListener() + columnDownloadPopupItems[i].addActionListener(ae -> { + if(columnDownloadPopupItems[x].isSelected()) { - public void actionPerformed(ActionEvent ae) + downloadActiveTable.getColumnModel().addColumn(downloadColumns[x]); + PositionManagerImpl.getInstance().setDownloadColumnVisible(x, true); + PositionManagerImpl.getInstance() + .setDownloadColumnIndex(x, + downloadActiveTable.getColumnModel().getColumnIndex(downloadColumns[x].getIdentifier())); + } + else + { + downloadActiveTable.getColumnModel().removeColumn(downloadColumns[x]); + PositionManagerImpl.getInstance().setDownloadColumnVisible(x, false); + for(int y = 0; y < downloadColumns.length; y++) { - if(columnDownloadPopupItems[x].isSelected()) + try { - downloadActiveTable.getColumnModel().addColumn(downloadColumns[x]); - PositionManagerImpl.getInstance().setDownloadColumnVisible(x, true); PositionManagerImpl.getInstance() - .setDownloadColumnIndex(x, - downloadActiveTable.getColumnModel().getColumnIndex(downloadColumns[x].getIdentifier())); + .setDownloadColumnIndex(y, + downloadActiveTable.getColumnModel() + .getColumnIndex(downloadColumns[y].getIdentifier())); } - else + catch(IllegalArgumentException niaE) { - downloadActiveTable.getColumnModel().removeColumn(downloadColumns[x]); - PositionManagerImpl.getInstance().setDownloadColumnVisible(x, false); - for(int y = 0; y < downloadColumns.length; y++) - { - try - { - PositionManagerImpl.getInstance() - .setDownloadColumnIndex(y, - downloadActiveTable.getColumnModel() - .getColumnIndex(downloadColumns[y].getIdentifier())); - } - catch(IllegalArgumentException niaE) - { - ; - - //nix zu tun - } - } + //nix zu tun } } - }); + } + }); columnDownloadPopup.add(columnDownloadPopupItems[i]); } @@ -434,42 +428,36 @@ public void internalSort(int column, boolean ascent) columnDownloadSourcesPopupItems[i] = new JCheckBoxMenuItem((String) downloadSourceColumns[i].getHeaderValue()); final int x = i; - columnDownloadSourcesPopupItems[i].addActionListener(new ActionListener() + columnDownloadSourcesPopupItems[i].addActionListener(ae -> { + if(columnDownloadSourcesPopupItems[x].isSelected()) { - public void actionPerformed(ActionEvent ae) + downloadSourceTable.getColumnModel().addColumn(downloadSourceColumns[x]); + PositionManagerImpl.getInstance().setDownloadSourcesColumnVisible(x, true); + PositionManagerImpl.getInstance() + .setDownloadSourcesColumnIndex(x, + downloadSourceTable.getColumnModel() + .getColumnIndex(downloadSourceColumns[x].getIdentifier())); + } + else + { + downloadSourceTable.getColumnModel().removeColumn(downloadSourceColumns[x]); + PositionManagerImpl.getInstance().setDownloadSourcesColumnVisible(x, false); + for(int y = 0; y < downloadSourceColumns.length; y++) { - if(columnDownloadSourcesPopupItems[x].isSelected()) + try { - downloadSourceTable.getColumnModel().addColumn(downloadSourceColumns[x]); - PositionManagerImpl.getInstance().setDownloadSourcesColumnVisible(x, true); PositionManagerImpl.getInstance() - .setDownloadSourcesColumnIndex(x, + .setDownloadSourcesColumnIndex(y, downloadSourceTable.getColumnModel() - .getColumnIndex(downloadSourceColumns[x].getIdentifier())); + .getColumnIndex(downloadSourceColumns[y].getIdentifier())); } - else + catch(IllegalArgumentException niaE) { - downloadSourceTable.getColumnModel().removeColumn(downloadSourceColumns[x]); - PositionManagerImpl.getInstance().setDownloadSourcesColumnVisible(x, false); - for(int y = 0; y < downloadSourceColumns.length; y++) - { - try - { - PositionManagerImpl.getInstance() - .setDownloadSourcesColumnIndex(y, - downloadSourceTable.getColumnModel() - .getColumnIndex(downloadSourceColumns[y].getIdentifier())); - } - catch(IllegalArgumentException niaE) - { - ; - - //nix zu tun - } - } + //nix zu tun } } - }); + } + }); columnDownloadSourcesPopup.add(columnDownloadSourcesPopupItems[i]); } diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPartListPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPartListPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPartListPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPartListPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPartListWatcher.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPartListWatcher.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPartListWatcher.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPartListWatcher.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPropertyChangeListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPropertyChangeListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/DownloadPropertyChangeListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/DownloadPropertyChangeListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/PowerDownloadPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/PowerDownloadPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/PowerDownloadPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/PowerDownloadPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/RenameDownloadDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/RenameDownloadDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/RenameDownloadDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/RenameDownloadDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadMouseMotionListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadMouseMotionListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadMouseMotionListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadMouseMotionListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadSourcesTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadSourcesTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadSourcesTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadSourcesTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableDownloadFilenameCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableDownloadFilenameCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableDownloadFilenameCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableDownloadFilenameCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableFilenameCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableFilenameCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableFilenameCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableFilenameCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTablePowerdownloadCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTablePowerdownloadCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTablePowerdownloadCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTablePowerdownloadCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableStatusCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableStatusCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadTableStatusCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadTableStatusCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadToolTipUI.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadToolTipUI.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadToolTipUI.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadToolTipUI.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadsTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadsTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/download/table/DownloadsTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/download/table/DownloadsTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/listener/LanguageListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/listener/LanguageListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/listener/LanguageListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/listener/LanguageListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/memorymonitor/MemoryMonitor.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/memorymonitor/MemoryMonitor.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/memorymonitor/MemoryMonitor.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/memorymonitor/MemoryMonitor.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/memorymonitor/MemoryMonitorDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/memorymonitor/MemoryMonitorDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/memorymonitor/MemoryMonitorDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/memorymonitor/MemoryMonitorDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java similarity index 96% rename from AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java index 8cccaf6d..afaebf19 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPRequest.java @@ -26,7 +26,7 @@ public class HTTPRequest * * @param so der Socket, zum Lesen des Requests * @param log ein Logger-Objekt, damit pro Client unterschiedliche - * Log-Levels definiert werden knnen + * Log-Levels definiert werden können */ public HTTPRequest(Socket so) { @@ -39,7 +39,7 @@ public HTTPRequest(Socket so) /** * Liefert den Parameter-Wert zu n * @param n Name des Parameters - * @return der zugehrige Wert oder null + * @return der zugehörige Wert oder null */ public String getParameter(String n) { @@ -49,7 +49,7 @@ public String getParameter(String n) /** * Liefert das Header-Feld zu h * @param h Name des Headers - * @return das zugehrige Headerfeld. + * @return das zugehörige Headerfeld. */ public String getHeader(String h) { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java similarity index 96% rename from AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java index de8819c4..32379e1c 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/HTTPResponse.java @@ -30,7 +30,7 @@ public class HTTPResponse public final static int HTTP_InternalServerError = 5; public final static int HTTP_NotImplemented = 6; - /** String-Konstante fr HTTP-Repsonse-Code */ + /** String-Konstante für HTTP-Repsonse-Code */ public final static String[] ResponseCodes = { "200 OK", "301 Moved Permanently", "400 Bad Request", "403 Forbidden", @@ -38,7 +38,7 @@ public class HTTPResponse }; /** - * Der Dateinamen fr die Default-Datei, die verwendet wird, wenn nur ein + * Der Dateinamen für die Default-Datei, die verwendet wird, wenn nur ein * Verzeichnis abgefragt wird. */ public static String DefaultFile = "index.html"; @@ -54,18 +54,18 @@ public class HTTPResponse public static String FileNotFound = "not_found.html"; /** - * Zeitraum fr das Cachen HTTP-Antworten<br> - * unsere Daten knnen einen Tag gecacht werden: + * Zeitraum für das Cachen HTTP-Antworten<br> + * unsere Daten können einen Tag gecacht werden: */ public static String CacheControlSeconds = (3600 * 24) + ""; /** - * Der Mime-Typ fr unbekannte Dateien + * Der Mime-Typ für unbekannte Dateien */ public static final String DefaultMimeType = "application/octet-stream"; /** - * Der Mime-Typ fr einfache Text-Dateien, wird auch fr das Senden von + * Der Mime-Typ für einfache Text-Dateien, wird auch für das Senden von * Fehlermeldungen verwendet. */ public static final String PlainMimeType = "text/plain"; diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/MobileProxy.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/MobileProxy.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/mobileproxy/MobileProxy.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/mobileproxy/MobileProxy.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/IncomingDirSelectionDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/IncomingDirSelectionDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/IncomingDirSelectionDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/IncomingDirSelectionDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODAnsichtPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODAnsichtPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODAnsichtPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODAnsichtPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODConnectionPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODConnectionPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODConnectionPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODConnectionPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODDirectoryChooser.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODDirectoryChooser.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODDirectoryChooser.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODDirectoryChooser.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java similarity index 92% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java index 03e8dfde..126fd520 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginOptionsDialog.java @@ -60,13 +60,7 @@ private void init() { LanguageSelector languageSelector = LanguageSelector.getInstance(); - schliessen.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent ae) - { - ODPluginOptionsDialog.this.dispose(); - } - }); + schliessen.addActionListener(ae -> ODPluginOptionsDialog.this.dispose()); String title = pluginConnector.getTitle() + " - "; diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginPanel.java similarity index 89% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginPanel.java index a884b3d3..0841744e 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODPluginPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODPluginPanel.java @@ -102,13 +102,7 @@ private void init() throws Exception beschreibung.setWrapStyleWord(true); pluginList = new JList(v); pluginList.setPreferredSize(new Dimension(190, pluginList.getPreferredSize().height)); - pluginList.addListSelectionListener(new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - pluginList_valueChanged(e); - } - }); + pluginList.addListSelectionListener(e -> pluginList_valueChanged(e)); setLayout(new BorderLayout()); LanguageSelector languageSelector = LanguageSelector.getInstance(); @@ -131,19 +125,15 @@ public void valueChanged(ListSelectionEvent e) panel1.add(sp, BorderLayout.CENTER); panel1.add(panel2, BorderLayout.SOUTH); add(panel1, BorderLayout.CENTER); - einstellungen.addActionListener(new ActionListener() + einstellungen.addActionListener(ae -> { + if(selectedPluginConnector != null) { - public void actionPerformed(ActionEvent ae) - { - if(selectedPluginConnector != null) - { - ODPluginOptionsDialog pluginOptionsDialog = new ODPluginOptionsDialog(parentDialog, selectedPluginConnector); - - pluginOptionsDialog.setResizable(true); - pluginOptionsDialog.setVisible(true); - } - } - }); + ODPluginOptionsDialog pluginOptionsDialog = new ODPluginOptionsDialog(parentDialog, selectedPluginConnector); + + pluginOptionsDialog.setResizable(true); + pluginOptionsDialog.setVisible(true); + } + }); } void pluginList_valueChanged(ListSelectionEvent e) diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODProxyPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODProxyPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODProxyPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODProxyPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODStandardPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODStandardPanel.java similarity index 86% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODStandardPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODStandardPanel.java index 0728b373..80152ba5 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODStandardPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODStandardPanel.java @@ -12,8 +12,6 @@ import java.awt.GridBagLayout; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -27,8 +25,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JToolTip; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -87,8 +83,8 @@ public class ODStandardPanel extends JPanel implements OptionsRegister private JDialog parent; private AJSettings ajSettings; private TKLComboBox cmbLog; - private TKLComboBox updateInfoModus; - private TKLCheckBox loadPlugins = new TKLCheckBox(); + private TKLCheckBox updateNotification = new TKLCheckBox(); + private TKLCheckBox loadPlugins = new TKLCheckBox(); private Logger logger; private ConnectionSettings remote; private Icon menuIcon; @@ -123,18 +119,9 @@ public Level getLogLevel() return ((LevelItem) cmbLog.getSelectedItem()).getLevel(); } - public int getVersionsinfoModus() + public boolean getUpdateInfo() { - if(updateInfoModus.getSelectedIndex() == -1) - { - return 1; - } - else - { - UpdateInfoItem selectedItem = (UpdateInfoItem) updateInfoModus.getSelectedItem(); - - return selectedItem.getModus(); - } + return updateNotification.isSelected(); } public String getBrowserPfad() @@ -179,13 +166,7 @@ private void init() throws Exception levelItems[2] = new LevelItem(Level.OFF, languageSelector.getFirstAttrbuteByTagName("javagui.options.logging.off")); menuText = languageSelector.getFirstAttrbuteByTagName("einstform.standardsheet.caption"); cmbLog = new TKLComboBox(levelItems); - cmbLog.addItemListener(new ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - dirty = true; - } - }); + cmbLog.addItemListener(e -> dirty = true); int index = 0; @@ -206,57 +187,11 @@ else if(logLevel == Level.OFF) panel8.add(cmbLog); - updateInfoModus = new TKLComboBox(); - UpdateInfoItem item0 = new UpdateInfoItem(0, - languageSelector.getFirstAttrbuteByTagName("javagui.options.standard.updateinfo0")); - UpdateInfoItem item1 = new UpdateInfoItem(1, - languageSelector.getFirstAttrbuteByTagName("javagui.options.standard.updateinfo1")); - UpdateInfoItem item2 = new UpdateInfoItem(2, - languageSelector.getFirstAttrbuteByTagName("javagui.options.standard.updateinfo2")); - - updateInfoModus.addItem(item0); - updateInfoModus.addItem(item1); - updateInfoModus.addItem(item2); - int infoModus = optionsManager.getVersionsinfoModus(); - - switch(infoModus) - { - - case 0: - { - updateInfoModus.setSelectedItem(item0); - break; - } - - case 1: - { - updateInfoModus.setSelectedItem(item1); - break; - } - - case 2: - { - updateInfoModus.setSelectedItem(item2); - break; - } + updateNotification.setText(languageSelector.getFirstAttrbuteByTagName("javagui.options.standard.updateinfotext")); + updateNotification.setSelected(optionsManager.getUpdateInfo()); + updateNotification.addItemListener(e -> dirty = true); - default: - updateInfoModus.setSelectedIndex(-1); - } - updateInfoModus.addItemListener(new ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - dirty = true; - } - }); - - JPanel panel9 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - JLabel label10 = new JLabel(languageSelector.getFirstAttrbuteByTagName("javagui.options.standard.updateinfotext")); - - panel9.add(label10); - panel9.add(updateInfoModus); setLayout(new BorderLayout()); port.setHorizontalAlignment(JLabel.RIGHT); @@ -303,13 +238,7 @@ public void itemStateChanged(ItemEvent e) selectStandardBrowser.addMouseListener(new SelectBrowserMouseListener()); - loadPlugins.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - dirty = true; - } - }); + loadPlugins.addChangeListener(e -> dirty = true); GridBagConstraints constraints = new GridBagConstraints(); @@ -319,14 +248,16 @@ public void stateChanged(ChangeEvent e) constraints.gridy = 0; constraints.insets.top = 5; - JPanel panel1 = new JPanel(new GridBagLayout()); + JPanel panel1 = new JPanel(new GridBagLayout()); JPanel panel2 = new JPanel(new GridBagLayout()); JPanel panel3 = new JPanel(new GridBagLayout()); JPanel panel4 = new JPanel(new GridBagLayout()); JPanel panel7 = new JPanel(new GridBagLayout()); JPanel panel10 = new JPanel(new GridBagLayout()); + JPanel panel9 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel panel11 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + panel9.add(updateNotification); panel11.add(loadPlugins); constraints.insets.right = 5; @@ -389,6 +320,7 @@ public void stateChanged(ChangeEvent e) panel6.add(hint5, constraints); constraints.gridy = 7; constraints.gridx = 0; + constraints.gridwidth = 5; panel6.add(panel9, constraints); constraints.gridy = 8; constraints.gridx = 0; @@ -403,10 +335,10 @@ public void stateChanged(ChangeEvent e) nick.confirmNewValue(); browser.confirmNewValue(); cmbLog.confirmNewValue(); - updateInfoModus.confirmNewValue(); + updateNotification.confirmNewValue(); loadPlugins.confirmNewValue(); - if(DesktopTools.isAdvancedSupported() && System.getProperty("os.name").toLowerCase().indexOf("linux") == -1) + if(DesktopTools.isAdvancedSupported() && !System.getProperty("os.name").toLowerCase().contains("linux")) { selectStandardBrowser.setVisible(false); browser.setVisible(false); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/ODVerbindungPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODVerbindungPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/ODVerbindungPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/ODVerbindungPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/OptionsDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/OptionsDialog.java similarity index 89% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/OptionsDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/OptionsDialog.java index 009e21cb..e624ae89 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/options/OptionsDialog.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/OptionsDialog.java @@ -26,6 +26,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import de.applejuicenet.client.gui.AppleJuiceDialog; import org.apache.log4j.Logger; import de.applejuicenet.client.AppleJuiceClient; @@ -51,11 +52,11 @@ */ public class OptionsDialog extends JDialog { + private static final Logger logger = Logger.getLogger(OptionsDialog.class); private JFrame parent; private JButton speichern; private JButton abbrechen; private AJSettings ajSettings; - private Logger logger; private ConnectionSettings remote; private JList menuList; private OptionsRegister[] optionPanels; @@ -65,7 +66,6 @@ public class OptionsDialog extends JDialog public OptionsDialog(JFrame parent) throws HeadlessException { super(parent, true); - logger = Logger.getLogger(getClass()); try { this.parent = parent; @@ -99,32 +99,16 @@ private void init() throws Exception registerPanel.add(optionPanels[i].getMenuText(), (JPanel) optionPanels[i]); } - menuList.addListSelectionListener(new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent listSelectionEvent) - { - Object selected = menuList.getSelectedValue(); + menuList.addListSelectionListener(listSelectionEvent -> { + Object selected = menuList.getSelectedValue(); - registerLayout.show(registerPanel, ((OptionsRegister) selected).getMenuText()); - } - }); + registerLayout.show(registerPanel, ((OptionsRegister) selected).getMenuText()); + }); menuList.setSelectedValue(optionPanels[0], true); speichern = new JButton(languageSelector.getFirstAttrbuteByTagName("einstform.Button1.caption")); abbrechen = new JButton(languageSelector.getFirstAttrbuteByTagName("einstform.Button2.caption")); - abbrechen.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dispose(); - } - }); - speichern.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - speichern(); - } - }); + abbrechen.addActionListener(e -> dispose()); + speichern.addActionListener(e -> speichern()); JPanel panel = new JPanel(); FlowLayout flowL = new FlowLayout(); @@ -158,10 +142,10 @@ private void speichern() om.saveAJSettings(ajSettings); om.setStandardBrowser(((ODStandardPanel) optionPanels[0]).getBrowserPfad()); om.loadPluginsOnStartup(((ODStandardPanel) optionPanels[0]).shouldLoadPluginsOnStartup()); + om.setUpdateInfo(((ODStandardPanel) optionPanels[0]).getUpdateInfo()); if(((ODStandardPanel) optionPanels[0]).isDirty()) { om.setLogLevel(((ODStandardPanel) optionPanels[0]).getLogLevel()); - om.setVersionsinfoModus(((ODStandardPanel) optionPanels[0]).getVersionsinfoModus()); } etwasGeaendert = true; diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/OptionsRegister.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/OptionsRegister.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/OptionsRegister.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/OptionsRegister.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/options/directorytree/DirectoryChooserTreeModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java similarity index 88% rename from AJClientGUI/src/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java index 28414186..ae3ea02d 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugincontrol/PluginFactory.java @@ -48,33 +48,8 @@ public static Set<PluginConnector> getPlugins() path = System.getProperty("user.dir") + File.separator + "plugins" + File.separator; } - File delFile = new File(path + "ajIrcPlugin_1_3.jar"); - - if(delFile.isFile()) - { - delFile.delete(); - } - - delFile = new File(path + "ajIrcPlugin_1_31.jar"); - if(delFile.isFile()) - { - delFile.delete(); - } - - delFile = new File(path + "IrcPlugin_1_31.jar"); - if(delFile.isFile()) - { - delFile.delete(); - } - File pluginPath = new File(path); - if(!pluginPath.isDirectory()) - { - pluginPath.mkdir(); - return plugins; - } - String[] tempListe = pluginPath.list(); PluginJarClassLoader jarLoader = null; @@ -131,7 +106,7 @@ public static Set<PluginConnector> getPlugins() private static Set<PluginConnector> loadPluginsFromClasspath() { Set<PluginConnector> thePlugins = new HashSet<PluginConnector>(); - String[] which = new String[] { //"de.applejuicenet.client.gui.plugins.jabber.JabberTestLoader",// + String[] which = new String[] { //"de.applejuicenet.client.gui.plugins.jabber.JabberTestLoader",// // "de.applejuicenet.client.gui.plugins.versionchecker.VersioncheckerTestLoader" // "de.applejuicenet.client.gui.plugins.serverwatcher.ServerWatcherTestLoader" // "de.applejuicenet.client.gui.plugins.logviewer.LogViewerTestLoader" diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/plugincontrol/TestLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugincontrol/TestLoader.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/plugincontrol/TestLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugincontrol/TestLoader.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/plugins/PluginConnector.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugins/PluginConnector.java similarity index 99% rename from AJClientGUI/src/de/applejuicenet/client/gui/plugins/PluginConnector.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugins/PluginConnector.java index 498a4857..bce5bb50 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/plugins/PluginConnector.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/plugins/PluginConnector.java @@ -212,7 +212,7 @@ public final String getLanguageString(String identifier) * @param type int: Typ des angesprochenen Listeners * @param content Object: Geaenderte Werte, Typ abhaengig vom * angesprochenen Listener - * @see DataUpdateListener.class + * @see DataUpdateListener */ public abstract void fireContentChanged(DATALISTENER_TYPE type, Object content); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java similarity index 98% rename from AJClientGUI/src/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java index 7d82e80f..ec4f0ddb 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/powerdownload/AutomaticPowerdownloadPolicy.java @@ -255,7 +255,7 @@ public boolean hasPropertiesDialog() } /** - * Diese Methode mit dem ffnen und Auswerten des Einstellungendialogs ueberschreiben. + * Diese Methode mit dem Öffnen und Auswerten des Einstellungendialogs ueberschreiben. */ public void showPropertiesDialog(Frame parent) { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/SearchController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchController.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/SearchController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchController.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/SearchPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/SearchPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/SearchResultPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchResultPanel.java similarity index 98% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/SearchResultPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchResultPanel.java index 2cc1ede8..8a10367a 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/search/SearchResultPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchResultPanel.java @@ -27,6 +27,7 @@ import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; +import de.applejuicenet.client.shared.ReleaseInfo; import org.apache.log4j.Logger; import de.applejuicenet.client.AppleJuiceClient; @@ -44,7 +45,6 @@ import de.applejuicenet.client.gui.search.table.SearchEntrySizeRenderer; import de.applejuicenet.client.gui.search.table.SearchTableModel; import de.applejuicenet.client.shared.IconManager; -import de.applejuicenet.client.shared.ReleaseInfoDialog; import de.applejuicenet.client.shared.SoundPlayer; /** @@ -142,8 +142,7 @@ public void actionPerformed(ActionEvent ae) SearchEntry curSearchEntry = searchResultTableModel.getRow(sel[0]); - ReleaseInfoDialog.showReleaseInfo(curSearchEntry.getChecksumme(), true, - curSearchEntry.getFileNames()[0].getDateiName(), curSearchEntry.getGroesse()); + ReleaseInfo.handle(curSearchEntry.getFileNames()[0].getDateiName(), curSearchEntry.getChecksumme(), curSearchEntry.getGroesse()); } }); popup.add(mnuReleaseInfo); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/SearchResultTabbedPane.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchResultTabbedPane.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/SearchResultTabbedPane.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/SearchResultTabbedPane.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchEntryIconRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchEntryIconRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchEntryIconRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchEntryIconRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchEntrySizeRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchEntrySizeRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchEntrySizeRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchEntrySizeRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/search/table/SearchTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/search/table/SearchTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/server/NewServerDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/NewServerDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/server/NewServerDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/NewServerDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/server/ServerPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/ServerPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/server/ServerPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/ServerPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableDateCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableDateCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableDateCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableDateCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/server/table/ServerTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/server/table/ServerTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/DateiListeDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/DateiListeDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/DateiListeDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/DateiListeDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/ShareController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareController.java similarity index 99% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/ShareController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareController.java index b686cd82..86d2ed6e 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/share/ShareController.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareController.java @@ -41,7 +41,7 @@ import de.applejuicenet.client.gui.share.tree.DirectoryNode; import de.applejuicenet.client.gui.share.tree.ShareSelectionTreeModel; import de.applejuicenet.client.shared.DesktopTools; -import de.applejuicenet.client.shared.ReleaseInfoDialog; +import de.applejuicenet.client.shared.ReleaseInfo; import de.applejuicenet.client.shared.SwingWorker; /** @@ -253,7 +253,7 @@ private void showReleaseInfo() { Share share = ((ShareNode) obj[0]).getShare(); - ReleaseInfoDialog.showReleaseInfo(share.getCheckSum()); + ReleaseInfo.handle(share.getShortfilename(), share.getCheckSum(), (long) share.getSize()); } } diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/SharePanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/SharePanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/SharePanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/SharePanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/ShareTableMouseAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareTableMouseAdapter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/ShareTableMouseAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareTableMouseAdapter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/ShareTreeMouseAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareTreeMouseAdapter.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/ShareTreeMouseAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/ShareTreeMouseAdapter.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/DateiListeTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/DateiListeTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/DateiListeTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/DateiListeTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/DragShareNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/DragShareNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/DragShareNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/DragShareNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTable.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTable.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTable.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTable.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/table/ShareTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/table/ShareTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/tree/DirectoryNode.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/DirectoryNode.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/tree/DirectoryNode.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/DirectoryNode.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/tree/DirectoryTree.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/DirectoryTree.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/tree/DirectoryTree.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/DirectoryTree.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/share/tree/ShareSelectionTreeModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/start/HyperlinkAdapter.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/HyperlinkAdapter.java similarity index 96% rename from AJClientGUI/src/de/applejuicenet/client/gui/start/HyperlinkAdapter.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/HyperlinkAdapter.java index a752def3..59548f95 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/start/HyperlinkAdapter.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/HyperlinkAdapter.java @@ -29,7 +29,7 @@ */ public class HyperlinkAdapter implements HyperlinkListener { - private Logger logger; + private static Logger logger; private Component parent; public HyperlinkAdapter(Component parent) @@ -65,7 +65,7 @@ else if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) } } - private void executeLink(String link) + public static void executeLink(String link) { try { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/start/NachrichtenWorker.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/NachrichtenWorker.java similarity index 85% rename from AJClientGUI/src/de/applejuicenet/client/gui/start/NachrichtenWorker.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/NachrichtenWorker.java index f93f9834..d04a2099 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/start/NachrichtenWorker.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/NachrichtenWorker.java @@ -61,7 +61,7 @@ public void run() } ProxySettings proxy = ProxyManagerImpl.getInstance().getProxySettings(); - String htmlText = WebsiteContentLoader.getWebsiteContent(proxy, "http://www.applejuicenet.org", 80, + String htmlText = WebsiteContentLoader.getWebsiteContent(proxy, "https://www.applejuicenet.de", 443, "/inprog/news.php?version=" + AppleJuiceClient.getAjFassade().getCoreVersion() .getVersion()); @@ -91,17 +91,12 @@ public void run() htmlText = buffer.toString(); final String htmlContent = htmlText; - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - version.setText("<html>GUI: " + AppleJuiceDialog.GUI_VERSION + "/" + ApplejuiceFassade.FASSADE_VERSION + - "<br>Core: " + coreVersion + "</html>"); - nachrichten.setContentType("text/html"); - nachrichten.setText(htmlContent); - nachrichten.setFont(version.getFont()); - } - }); + SwingUtilities.invokeLater(() -> { + version.setText("<html>GUI: " + AppleJuiceDialog.getVersion() + "<br>Core: " + coreVersion + "</html>"); + nachrichten.setContentType("text/html"); + nachrichten.setText(htmlContent); + nachrichten.setFont(version.getFont()); + }); } catch(Exception e) { diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/start/NorthPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/NorthPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/start/NorthPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/NorthPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/start/StartController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/StartController.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/start/StartController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/StartController.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/start/StartPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/StartPanel.java similarity index 98% rename from AJClientGUI/src/de/applejuicenet/client/gui/start/StartPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/StartPanel.java index bf84055e..9a162f4d 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/start/StartPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/start/StartPanel.java @@ -25,7 +25,7 @@ * $Header: * /cvsroot/applejuicejava/AJClientGUI/src/de/applejuicenet/client/gui/StartPanel.java,v * 1.57 2004/06/15 16:19:19 maj0r Exp $ - * + * * <p> * Titel: AppleJuice Client-GUI * </p> @@ -36,9 +36,9 @@ * <p> * Copyright: General Public License * </p> - * + * * @author: Maj0r [aj@tkl-soft.de] - * + * */ public class StartPanel extends TklPanel { @@ -61,7 +61,7 @@ public class StartPanel extends TklPanel { private NetworkInfo netInfo; private Information information; private LanguageSelector languageSelector; - + public StartPanel(GuiController guiController) { super(guiController); try { @@ -84,7 +84,7 @@ public JTextPane getServerMessagePane(){ public JTextPane getFaqPane(){ return faq; } - + public JLabel getLblVersion(){ return version; } @@ -124,7 +124,7 @@ public JLabel getLblDeinClient(){ public JLabel getLblNeuigkeiten(){ return neuigkeiten; } - + private void init() throws Exception { setLayout(new BorderLayout()); serverMessage = new JTextPane(); @@ -167,7 +167,7 @@ private void init() throws Exception { faq = new JTextPane(); faq.setContentType("text/html"); faq.setEditable(false); - faq.setText("<html><a href=\"http://www.applejuicenet.de/13.0.html\">FAQ</a></html>"); + faq.setText("<html><a href=\"https://www.applejuicenet.de/faq/\">FAQ</a></html>"); panel3.add(faq, constraints); constraints.gridy++; @@ -241,4 +241,4 @@ private void init() throws Exception { scrollPane.setBorder(null); add(scrollPane, BorderLayout.CENTER); } -} \ No newline at end of file +} diff --git a/ajtray/src/de/applejuicenet/client/gui/tray/DesktopToolJava6.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/DesktopTool.java similarity index 78% rename from ajtray/src/de/applejuicenet/client/gui/tray/DesktopToolJava6.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/DesktopTool.java index 13f77a6f..7ace3dfb 100644 --- a/ajtray/src/de/applejuicenet/client/gui/tray/DesktopToolJava6.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/DesktopTool.java @@ -3,16 +3,16 @@ */ package de.applejuicenet.client.gui.tray; -import java.awt.Desktop; + +import java.awt.*; import java.io.File; + import java.io.IOException; import java.net.URI; -import de.applejuicenet.client.shared.DesktopToolIF; - -public class DesktopToolJava6 implements DesktopToolIF +public class DesktopTool { - public DesktopToolJava6() + public DesktopTool() { if(!Desktop.isDesktopSupported()) { @@ -20,7 +20,6 @@ public DesktopToolJava6() } } - @Override public void browse(URI uri) { try @@ -33,7 +32,6 @@ public void browse(URI uri) } } - @Override public void open(File toOpen) { try diff --git a/ajtray/src/de/applejuicenet/client/gui/tray/TrayLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/TrayLoader.java similarity index 88% rename from ajtray/src/de/applejuicenet/client/gui/tray/TrayLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/TrayLoader.java index 52d4b445..eeaf8223 100644 --- a/ajtray/src/de/applejuicenet/client/gui/tray/TrayLoader.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/tray/TrayLoader.java @@ -3,31 +3,30 @@ */ package de.applejuicenet.client.gui.tray; -import java.awt.AWTException; -import java.awt.Image; -import java.awt.SystemTray; -import java.awt.TrayIcon; +import de.applejuicenet.client.gui.AppleJuiceDialog; +import de.applejuicenet.client.shared.IconManager; + +import javax.swing.*; +import java.awt.*; import java.awt.TrayIcon.MessageType; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.Icon; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; - -import de.applejuicenet.client.gui.AppleJuiceDialog; - -public class TrayLoader implements TrayIF +public class TrayLoader { private String zeigen; private String verstecken; private TrayIcon trayIcon = null; - public boolean makeTray(Image image, String title, final AppleJuiceDialog dialog, final JMenuItem popupShowHideMenuItem, + public boolean makeTray( String title, final AppleJuiceDialog dialog, final JMenuItem popupShowHideMenuItem, final Icon zeigenIcon, final Icon versteckenIcon, final JPopupMenu popup) { SystemTray tray = SystemTray.getSystemTray(); + IconManager im = IconManager.getInstance(); + + Image image = im.getIcon("applejuice").getImage(); + trayIcon = new TrayIcon(image, title, null); trayIcon.setImageAutoSize(true); diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/HeaderPopupListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/HeaderPopupListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/HeaderPopupListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/HeaderPopupListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadController.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadController.java similarity index 93% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadController.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadController.java index aa6a2f60..a9cbc99b 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadController.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadController.java @@ -21,6 +21,7 @@ import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; +import de.applejuicenet.client.shared.ReleaseInfo; import org.apache.log4j.Level; import de.applejuicenet.client.AppleJuiceClient; @@ -45,6 +46,7 @@ public class UploadController extends GuiController private static final int COPY_TO_CLIPBOARD = 4; private static final int HEADER_WAITING_DRAGGED = 8; private static final int HEADER_WAITING_POPUP = 9; + private static final int RELEASE_INFO = 18; private final UploadPanel uploadPanel; private boolean componentSelected = false; private boolean initialized = false; @@ -93,6 +95,7 @@ private void init() uploadPanel.getUploadActiveTable().addMouseListener(new UploadTableMouseListener(this, TABLE_MOUSE_CLICKED)); uploadPanel.getUploadActiveTable().addMouseListener(new UploadTablePopupListener(this, TABLE_POPUP)); uploadPanel.getMnuCopyToClipboard().addActionListener(new GuiControllerActionListener(this, COPY_TO_CLIPBOARD)); + uploadPanel.getMnuReleaseInfo().addActionListener(new GuiControllerActionListener(this, RELEASE_INFO)); uploadPanel.getUploadWaitingTable().getTableHeader().addMouseListener(new HeaderPopupListener(this, HEADER_WAITING_POPUP)); uploadPanel.getUploadWaitingTable().getTableHeader() @@ -146,11 +149,48 @@ public void fireAction(int actionId, Object obj) break; } + case RELEASE_INFO: + { + showReleaseInfo(); + break; + } + default: logger.error("Unregistrierte EventId " + actionId); } } + private void showReleaseInfo() + { + int selected = uploadPanel.getUploadActiveTable().getSelectedRow(); + + if(selected == -1) + { + return; + } + + Share shareObj = getShareObject4SelectedRow(selected); + + if(shareObj != null) + { + ReleaseInfo.handle(shareObj.getShortfilename(), shareObj.getCheckSum(), shareObj.getSize()); + } + } + + private Share getShareObject4SelectedRow(int selected) { + Upload upload = uploadPanel.getUploadActiveTableModel().getRow(selected); + + Integer shareFileId = upload.getShareFileID(); + Map<Integer, Share> share = AppleJuiceClient.getAjFassade().getShare(false); + + if(share.containsKey(shareFileId)) + { + return share.get(shareFileId); + } + + return null; + } + private void headerDragged() { PositionManager pm = PositionManagerImpl.getInstance(); @@ -235,26 +275,15 @@ private void copyLinkToClipboard() return; } - Upload upload = uploadPanel.getUploadActiveTableModel().getRow(selected); + Share shareObj = getShareObject4SelectedRow(selected); - Integer shareFileId = upload.getShareFileID(); - Map<Integer, Share> share = AppleJuiceClient.getAjFassade().getShare(false); - - if(share.containsKey(shareFileId)) - { - Share shareObj = share.get(shareFileId); + if(shareObj != null) { + Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringBuffer toCopy = new StringBuffer(); - if(share != null) - { - Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); - StringBuffer toCopy = new StringBuffer(); - - toCopy.append("ajfsp://file|"); - toCopy.append(shareObj.getShortfilename() + "|" + shareObj.getCheckSum() + "|" + shareObj.getSize() + "/"); - StringSelection contents = new StringSelection(toCopy.toString()); - - cb.setContents(contents, null); - } + toCopy.append(shareObj.getAjfspLink()); + StringSelection contents = new StringSelection(toCopy.toString()); + cb.setContents(contents, null); } } @@ -492,6 +521,7 @@ protected void languageChanged() warteschlangeVoll = languageSelector.getFirstAttrbuteByTagName("javagui.downloadform.warteschlangevoll"); uploadPanel.getMnuCopyToClipboard().setText(languageSelector.getFirstAttrbuteByTagName("mainform.getlink1.caption")); + uploadPanel.getMnuReleaseInfo().setText(languageSelector.getFirstAttrbuteByTagName("releaseinfo.menu")); } protected void contentChanged(DATALISTENER_TYPE type, final Object content) diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadMouseMotionListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadMouseMotionListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadMouseMotionListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadMouseMotionListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadPanel.java similarity index 74% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadPanel.java index a06a6c51..5fba2f20 100644 --- a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadPanel.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadPanel.java @@ -4,17 +4,11 @@ package de.applejuicenet.client.gui.upload; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.Date; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JLabel; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTable; +import javax.swing.*; import javax.swing.table.JTableHeader; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; @@ -67,7 +61,8 @@ public class UploadPanel extends TklPanel implements RegisterI { private JLabel uploadListeLabel = new JLabel("0 Clients in Deiner Uploadliste"); private JPopupMenu popupMenu = new JPopupMenu(); - private JMenuItem itemCopyToClipboard; + private JMenuItem itemCopyToClipboard = new JMenuItem(); + private JMenuItem itemReleaseInfo = new JMenuItem(); private JPopupMenu columnActivePopup = new JPopupMenu(); private TableColumn[] columnsActiveUploads = new TableColumn[7]; private JCheckBoxMenuItem[] columnPopupItemsActiveUploads = new JCheckBoxMenuItem[columnsActiveUploads.length]; @@ -99,7 +94,7 @@ private void init() throws Exception { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[][] sizes = + double[][] sizes = { {5, f, 5}, {5, f, f, p} @@ -119,6 +114,26 @@ private void init() throws Exception uploadActiveTable.getColumnModel().getColumn(5).setCellRenderer(new UploadTablePrioCellRenderer()); uploadActiveTable.getColumnModel().getColumn(6).setCellRenderer(new VersionTableCellRenderer()); + uploadActiveTable.addMouseListener(new MouseAdapter() + { + @Override + public void mouseClicked(MouseEvent e) + { + if(SwingUtilities.isRightMouseButton(e)) + { + + int row = uploadActiveTable.rowAtPoint(e.getPoint()); + + if(!uploadActiveTable.getSelectionModel().isSelectedIndex(row)) + { + uploadActiveTable.getSelectionModel().setSelectionInterval(row, row); + } + + maybeShowUploadPopup(e); + } + } + }); + TableColumnModel modelActive = uploadActiveTable.getColumnModel(); for(int i = 0; i < columnsActiveUploads.length; i++) @@ -127,41 +142,35 @@ private void init() throws Exception columnPopupItemsActiveUploads[i] = new JCheckBoxMenuItem((String) columnsActiveUploads[i].getHeaderValue()); final int x = i; - columnPopupItemsActiveUploads[i].addActionListener(new ActionListener() + columnPopupItemsActiveUploads[i].addActionListener(ae -> { + if(columnPopupItemsActiveUploads[x].isSelected()) + { + uploadActiveTable.getColumnModel().addColumn(columnsActiveUploads[x]); + PositionManagerImpl.getInstance().setUploadColumnVisible(x, true); + PositionManagerImpl.getInstance() + .setUploadColumnIndex(x, + uploadActiveTable.getColumnModel().getColumnIndex(columnsActiveUploads[x].getIdentifier())); + } + else { - public void actionPerformed(ActionEvent ae) + uploadActiveTable.getColumnModel().removeColumn(columnsActiveUploads[x]); + PositionManagerImpl.getInstance().setUploadColumnVisible(x, false); + for(int y = 0; y < columnsActiveUploads.length; y++) { - if(columnPopupItemsActiveUploads[x].isSelected()) + try { - uploadActiveTable.getColumnModel().addColumn(columnsActiveUploads[x]); - PositionManagerImpl.getInstance().setUploadColumnVisible(x, true); PositionManagerImpl.getInstance() - .setUploadColumnIndex(x, - uploadActiveTable.getColumnModel().getColumnIndex(columnsActiveUploads[x].getIdentifier())); + .setUploadColumnIndex(y, + uploadActiveTable.getColumnModel() + .getColumnIndex(columnsActiveUploads[y].getIdentifier())); } - else + catch(IllegalArgumentException niaE) { - uploadActiveTable.getColumnModel().removeColumn(columnsActiveUploads[x]); - PositionManagerImpl.getInstance().setUploadColumnVisible(x, false); - for(int y = 0; y < columnsActiveUploads.length; y++) - { - try - { - PositionManagerImpl.getInstance() - .setUploadColumnIndex(y, - uploadActiveTable.getColumnModel() - .getColumnIndex(columnsActiveUploads[y].getIdentifier())); - } - catch(IllegalArgumentException niaE) - { - ; - - //nix zu tun - } - } + //nix zu tun } } - }); + } + }); columnActivePopup.add(columnPopupItemsActiveUploads[i]); } @@ -220,42 +229,38 @@ public void internalSort(int column, boolean ascent) columnPopupItemsWaitingUploads[i] = new JCheckBoxMenuItem((String) columnsWaitingUploads[i].getHeaderValue()); final int x = i; - columnPopupItemsWaitingUploads[i].addActionListener(new ActionListener() + columnPopupItemsWaitingUploads[i].addActionListener(ae -> { + if(columnPopupItemsWaitingUploads[x].isSelected()) + { + uploadWaitingTable.getColumnModel().addColumn(columnsWaitingUploads[x]); + PositionManagerImpl.getInstance().setUploadWaitingColumnVisible(x, true); + PositionManagerImpl.getInstance() + .setUploadWaitingColumnIndex(x, + uploadWaitingTable.getColumnModel() + .getColumnIndex(columnsWaitingUploads[x].getIdentifier())); + } + else { - public void actionPerformed(ActionEvent ae) + uploadWaitingTable.getColumnModel().removeColumn(columnsWaitingUploads[x]); + PositionManagerImpl.getInstance().setUploadWaitingColumnVisible(x, false); + for(int y = 0; y < columnsWaitingUploads.length; y++) { - if(columnPopupItemsWaitingUploads[x].isSelected()) + try { - uploadWaitingTable.getColumnModel().addColumn(columnsWaitingUploads[x]); - PositionManagerImpl.getInstance().setUploadWaitingColumnVisible(x, true); PositionManagerImpl.getInstance() - .setUploadWaitingColumnIndex(x, + .setUploadWaitingColumnIndex(y, uploadWaitingTable.getColumnModel() - .getColumnIndex(columnsWaitingUploads[x].getIdentifier())); + .getColumnIndex(columnsWaitingUploads[y].getIdentifier())); } - else + catch(IllegalArgumentException niaE) { - uploadWaitingTable.getColumnModel().removeColumn(columnsWaitingUploads[x]); - PositionManagerImpl.getInstance().setUploadWaitingColumnVisible(x, false); - for(int y = 0; y < columnsWaitingUploads.length; y++) - { - try - { - PositionManagerImpl.getInstance() - .setUploadWaitingColumnIndex(y, - uploadWaitingTable.getColumnModel() - .getColumnIndex(columnsWaitingUploads[y].getIdentifier())); - } - catch(IllegalArgumentException niaE) - { - ; - - //nix zu tun - } - } + ; + + //nix zu tun } } - }); + } + }); columnWaitingPopup.add(columnPopupItemsWaitingUploads[i]); } @@ -270,14 +275,31 @@ public void actionPerformed(ActionEvent ae) JScrollPane aScrollPaneWaiting = new JScrollPane(uploadWaitingTable); + IconManager im = IconManager.getInstance(); + aScrollPaneWaiting.setBackground(uploadWaitingTable.getBackground()); aScrollPaneWaiting.getViewport().setOpaque(false); add(aScrollPaneWaiting, "1, 2"); add(uploadListeLabel, "1, 3, L, T"); - itemCopyToClipboard = new JMenuItem(); - itemCopyToClipboard.setIcon(IconManager.getInstance().getIcon("clipboard")); + itemCopyToClipboard.setIcon(im.getIcon("clipboard")); popupMenu.add(itemCopyToClipboard); + + itemReleaseInfo.setIcon(im.getIcon("hint")); + + popupMenu.add(itemReleaseInfo); + } + + private void maybeShowUploadPopup(MouseEvent e) + { + int[] selected = uploadActiveTable.getSelectedRows(); + + if(null == selected || selected.length == 0) + { + return; + } + + getPopup().show(uploadActiveTable, e.getX(), e.getY()); } public int[] getColumnActiveWidths() @@ -368,4 +390,9 @@ public JMenuItem getMnuCopyToClipboard() { return itemCopyToClipboard; } + + public JMenuItem getMnuReleaseInfo() + { + return itemReleaseInfo; + } } diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadTableMouseListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadTableMouseListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadTableMouseListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadTableMouseListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadTablePopupListener.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadTablePopupListener.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/UploadTablePopupListener.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/UploadTablePopupListener.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadActiveTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadActiveTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadActiveTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadActiveTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableDateCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableDateCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableDateCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableDateCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableFilenameCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableFilenameCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableFilenameCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableFilenameCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTablePrioCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTablePrioCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTablePrioCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTablePrioCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableWaitingStatusCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableWaitingStatusCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadTableWaitingStatusCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadTableWaitingStatusCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadWaitingTableModel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadWaitingTableModel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/upload/table/UploadWaitingTableModel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/upload/table/UploadWaitingTableModel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/ConnectionKind.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/ConnectionKind.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/ConnectionKind.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/ConnectionKind.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/ConnectionXML.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/ConnectionXML.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/ConnectionXML.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/ConnectionXML.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt1Panel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt1Panel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt1Panel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt1Panel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt2Panel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt2Panel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt2Panel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt2Panel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt3Panel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt3Panel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt3Panel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt3Panel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt4Panel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt4Panel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt4Panel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt4Panel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt5Panel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt5Panel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/Schritt5Panel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/Schritt5Panel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/WizardDialog.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/WizardDialog.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/WizardDialog.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/WizardDialog.java diff --git a/AJClientGUI/src/de/applejuicenet/client/gui/wizard/WizardPanel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/WizardPanel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/gui/wizard/WizardPanel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/gui/wizard/WizardPanel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/ConnectionSettings.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/ConnectionSettings.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/ConnectionSettings.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/ConnectionSettings.java diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/DesktopTools.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/DesktopTools.java new file mode 100644 index 00000000..685cd095 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/DesktopTools.java @@ -0,0 +1,52 @@ +/* + * Copyright 2006 TKLSoft.de All rights reserved. + */ + +package de.applejuicenet.client.shared; + +import java.io.File; + +import java.net.URI; + +import javax.swing.JOptionPane; + +import de.applejuicenet.client.gui.AppleJuiceDialog; +import de.applejuicenet.client.gui.controller.LanguageSelector; +import de.applejuicenet.client.gui.controller.OptionsManagerImpl; +import de.applejuicenet.client.gui.tray.DesktopTool; + +public class DesktopTools { + private static DesktopTool desktopToolIF; + + static { + desktopToolIF = new DesktopTool(); + } + + public static boolean isAdvancedSupported() { + return null != desktopToolIF; + } + + public static void browse(URI uri) { + if (null != desktopToolIF && !System.getProperty("os.name").toLowerCase().contains("linux")) { + desktopToolIF.browse(uri); + } else { + String browser = OptionsManagerImpl.getInstance().getStandardBrowser(); + + try { + Runtime.getRuntime().exec(new String[]{browser, uri.toURL().toString()}); + } catch (Exception ex) { + LanguageSelector ls = LanguageSelector.getInstance(); + String nachricht = ls.getFirstAttrbuteByTagName("javagui.startup.updatefehlernachricht"); + String titel = ls.getFirstAttrbuteByTagName("mainform.caption"); + + JOptionPane.showMessageDialog(AppleJuiceDialog.getApp(), nachricht, titel, JOptionPane.INFORMATION_MESSAGE); + } + } + } + + public static void open(File toOpen) { + if (null != desktopToolIF) { + desktopToolIF.open(toOpen); + } + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/IconManager.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/IconManager.java new file mode 100644 index 00000000..03fb9c3f --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/IconManager.java @@ -0,0 +1,140 @@ +/* + * Copyright 2006 TKLSoft.de All rights reserved. + */ + +package de.applejuicenet.client.shared; + +import java.awt.Image; +import java.awt.Toolkit; + +import java.io.File; +import java.io.FileInputStream; + +import java.io.FileNotFoundException; +import java.net.URL; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import javax.swing.ImageIcon; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +/** + * <p>Titel: AppleJuice Client-GUI</p> + * <p>Beschreibung: Offizielles GUI fuer den von muhviehstarr entwickelten appleJuice-Core</p> + * <p>Copyright: General Public License</p> + * + * @author: Maj0r [aj@tkl-soft.de] + */ +public class IconManager { + private static IconManager instance = null; + private final Logger logger; + private final Map<String, ImageIcon> icons; + private String pluginPath; + + private IconManager() { + logger = Logger.getLogger(getClass()); + icons = new HashMap<>(); + if (!System.getProperty("os.name").toLowerCase().contains("windows")) { + pluginPath = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui" + File.separator + "plugins" + File.separator; + } else { + pluginPath = System.getProperty("user.dir") + File.separator + "plugins" + File.separator; + } + } + + public static IconManager getInstance() { + if (instance == null) { + instance = new IconManager(); + } + + return instance; + } + + public ImageIcon getIcon(String key) { + ImageIcon result = null; + + try { + + if (icons.containsKey(key)) { + result = icons.get(key); + } else { + String path; + String pathGif = System.getProperty("user.dir") + File.separator + "icons" + File.separator + key + ".gif"; + String pathPng = System.getProperty("user.dir") + File.separator + "icons" + File.separator + key + ".png"; + + File fileGif = new File(pathGif); + File filePng = new File(pathPng); + + if (filePng.exists() && !filePng.isDirectory()) { + path = pathPng; + } + else if (fileGif.exists() && !fileGif.isDirectory()) { + path = pathGif; + } + else { + throw new FileNotFoundException("No Icon for " + key + " found (.gif or .png)"); + } + + Image img = Toolkit.getDefaultToolkit().getImage(path); + + result = new ImageIcon(img); + icons.put(key, result); + } + } catch (Exception e) { + if (logger.isEnabledFor(Level.INFO)) { + logger.info("Icon " + key + ".gif nicht gefunden", e); + } + } + + return result; + } + + @SuppressWarnings("unchecked") + public ImageIcon getIcon(String key, boolean isPlugin, Class referenceClass) { + if (!isPlugin) { + return getIcon(key); + } + + ImageIcon result = null; + + try { + result = icons.get(key); + if (null == result) { + URL url = referenceClass.getClassLoader().getResource(key + ".gif"); + + Image img = Toolkit.getDefaultToolkit().getImage(url); + + result = new ImageIcon(img); + icons.put(key, result); + } + } catch (Exception e) { + if (logger.isEnabledFor(Level.INFO)) { + logger.info("Plugin-Icon " + key + ".gif nicht gefunden", e); + } + } + + return result; + } + + public Properties getIconProperties(String identifier) { + String path = System.getProperty("user.dir") + File.separator + "icons" + File.separator + identifier + ".properties"; + File aFile = new File(path); + + if (aFile.isFile()) { + Properties props = new Properties(); + + try { + props.load(new FileInputStream(aFile)); + } catch (Exception e) { + return null; + } + + return props; + } else { + return null; + } + } +} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/LookAFeel.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/LookAFeel.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/LookAFeel.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/LookAFeel.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/MultiLineToolTip.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/MultiLineToolTip.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/MultiLineToolTip.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/MultiLineToolTip.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/NumberAndSpecialCharsInputVerifier.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/NumberAndSpecialCharsInputVerifier.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/NumberAndSpecialCharsInputVerifier.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/NumberAndSpecialCharsInputVerifier.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/NumberInputVerifier.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/NumberInputVerifier.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/NumberInputVerifier.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/NumberInputVerifier.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/PluginJarClassLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/PluginJarClassLoader.java similarity index 96% rename from AJClientGUI/src/de/applejuicenet/client/shared/PluginJarClassLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/PluginJarClassLoader.java index 313e51b3..0bf7cceb 100644 --- a/AJClientGUI/src/de/applejuicenet/client/shared/PluginJarClassLoader.java +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/PluginJarClassLoader.java @@ -4,16 +4,14 @@ package de.applejuicenet.client.shared; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.lang.reflect.Constructor; import java.net.MalformedURLException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.security.SecureClassLoader; import java.util.Enumeration; @@ -136,7 +134,7 @@ private void loadClassBytesFromJar(File jar) throws Exception InputStream iS = jf.getInputStream(entry); pluginProperties = new Properties(); - pluginProperties.load(iS); + pluginProperties.load(new InputStreamReader(iS, StandardCharsets.UTF_8)); } else if(entryName.indexOf("icon.gif") != -1) { @@ -155,9 +153,9 @@ else if(entryName.startsWith("language_") && entryName.endsWith(".properties")) { InputStream iS = jf.getInputStream(entry); - Properties curLanguageProperties = new Properties(); + Properties curLanguageProperties = new Properties(); - curLanguageProperties.load(iS); + curLanguageProperties.load(new InputStreamReader(iS, StandardCharsets.UTF_8)); String sprache = curLanguageProperties.getProperty("language"); diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/PolicyJarClassLoader.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/PolicyJarClassLoader.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/PolicyJarClassLoader.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/PolicyJarClassLoader.java diff --git a/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/ReleaseInfo.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/ReleaseInfo.java new file mode 100644 index 00000000..1ca5e061 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/ReleaseInfo.java @@ -0,0 +1,61 @@ +package de.applejuicenet.client.shared; + +import de.applejuicenet.client.gui.start.HyperlinkAdapter; + +import java.io.*; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Properties; + +public class ReleaseInfo { + + private static final String defaultHost = "http://www.apple-deluxe.cc/index.php?ct=403&va=%s"; + + private static String releaseInfoHost = null; + + private static void init() { + if (null == releaseInfoHost) { + Properties props = new Properties(); + String path = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui" + File.separator + "rel.properties"; + + File aFile = new File(path); + if (aFile.exists()) { + try { + FileInputStream fiS = new FileInputStream(aFile); + props.load(fiS); + fiS.close(); + + releaseInfoHost = props.getProperty("host", defaultHost); + } catch (Exception e) { + // nix zu tun + } + } else { + props.setProperty("host", defaultHost); + try (OutputStream outputStream = new FileOutputStream(aFile)) { + props.store(outputStream, null); + } catch (IOException e) { + // nix zu tun + } + } + + releaseInfoHost = (releaseInfoHost == null) ? defaultHost : releaseInfoHost; + } + } + + public static void handle(String filename, String hash, Long size) { + init(); + + String ajfsp = String.format("ajfsp://file%%7C%s%%7C%s%%7C%s/", encodeValue(filename), hash, size); + + HyperlinkAdapter.executeLink(String.format(releaseInfoHost, ajfsp)); + } + + private static String encodeValue(String value) { + try { + return URLEncoder.encode(value, StandardCharsets.UTF_8.toString()); + } catch (UnsupportedEncodingException ex) { + throw new RuntimeException(ex.getCause()); + } + } + +} diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/Settings.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/Settings.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/Settings.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/Settings.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/SoundPlayer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/SoundPlayer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/SoundPlayer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/SoundPlayer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/Splash.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/Splash.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/Splash.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/Splash.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/SwingWorker.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/SwingWorker.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/SwingWorker.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/SwingWorker.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/exception/InvalidPasswordException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/InvalidPasswordException.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/exception/InvalidPasswordException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/InvalidPasswordException.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/exception/LanguageSelectorNotInstanciatedException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/LanguageSelectorNotInstanciatedException.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/exception/LanguageSelectorNotInstanciatedException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/LanguageSelectorNotInstanciatedException.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/exception/NoIconAvailableException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/NoIconAvailableException.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/exception/NoIconAvailableException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/NoIconAvailableException.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/exception/NodeAlreadyExistsException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/NodeAlreadyExistsException.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/exception/NodeAlreadyExistsException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/NodeAlreadyExistsException.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/exception/PartlistException.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/PartlistException.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/exception/PartlistException.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/exception/PartlistException.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/icons/DummyClass.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/icons/DummyClass.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/icons/DummyClass.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/icons/DummyClass.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/ProgressTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/ProgressTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/ProgressTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/ProgressTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/SizeTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/SizeTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/SizeTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/SizeTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/SpeedTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/SpeedTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/SpeedTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/SpeedTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/StringTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/StringTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/StringTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/StringTableCellRenderer.java diff --git a/AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/VersionTableCellRenderer.java b/modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/VersionTableCellRenderer.java similarity index 100% rename from AJClientGUI/src/de/applejuicenet/client/shared/tablecellrenderer/VersionTableCellRenderer.java rename to modules/AJCoreGUI/src/main/java/de/applejuicenet/client/shared/tablecellrenderer/VersionTableCellRenderer.java diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/LICENSE.md b/modules/AJCoreGUI/src/main/java/de/tklsoft/LICENSE.md new file mode 100644 index 00000000..210895e2 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/LICENSE.md @@ -0,0 +1,130 @@ +Mozilla Public License Version 1.1 +1. Definitions. + +1.0.1. "Commercial Use" + means distribution or otherwise making the Covered Code available to a third party. +1.1. "Contributor" + means each entity that creates or contributes to the creation of Modifications. +1.2. "Contributor Version" + means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. +1.3. "Covered Code" + means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. +1.4. "Electronic Distribution Mechanism" + means a mechanism generally accepted in the software development community for the electronic transfer of data. +1.5. "Executable" + means Covered Code in any form other than Source Code. +1.6. "Initial Developer" + means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. +1.7. "Larger Work" + means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. +1.8. "License" + means this document. +1.8.1. "Licensable" + means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. +1.9. "Modifications" + + means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: + + 1. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. + 2. Any new file that contains any part of the Original Code or previous Modifications. + +1.10. "Original Code" + means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. +1.10.1. "Patent Claims" + means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. +1.11. "Source Code" + means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. +1.12. "You" (or "Your") + means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. Source Code License. +2.1. The Initial Developer Grant. + +The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: + + 1. under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and + 2. under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). + 3. the licenses granted in this Section 2.1 (a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. + 4. Notwithstanding Section 2.1 (b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. + +2.2. Contributor Grant. + +Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license + + 1. under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and + 2. under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + 3. the licenses granted in Sections 2.2 (a) and 2.2 (b) are effective on the date Contributor first makes Commercial Use of the Covered Code. + 4. Notwithstanding Section 2.2 (b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. +3.1. Application of License. + +The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. +3.2. Availability of Source Code. + +Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. +3.3. Description of Modifications. + +You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. +3.4. Intellectual Property Matters +(a) Third Party Claims + +If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. +(b) Contributor APIs + +If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the legal file. +(c) Representations. + +Contributor represents that, except as disclosed pursuant to Section 3.4 (a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. +3.5. Required Notices. + +You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. +3.6. Distribution of Executable Versions. + +You may distribute Covered Code in Executable form only if the requirements of Sections 3.1, 3.2, 3.3, 3.4 and 3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. +3.7. Larger Works. + +You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. +4. Inability to Comply Due to Statute or Regulation. + +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the legal file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. +5. Application of this License. + +This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. +6. Versions of the License. +6.1. New Versions + +Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. +6.2. Effect of New Versions + +Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. +6.3. Derivative Works + +If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) +7. Disclaimer of warranty + +Covered code is provided under this license on an "as is" basis, without warranty of any kind, either expressed or implied, including, without limitation, warranties that the covered code is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the covered code is with you. Should any covered code prove defective in any respect, you (not the initial developer or any other contributor) assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty constitutes an essential part of this license. No use of any covered code is authorized hereunder except under this disclaimer. +8. Termination + +8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + +8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: + + 1. such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. + 2. any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. + +8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + +8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. +9. Limitation of liability + +Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall you, the initial developer, any other contributor, or any distributor of covered code, or any supplier of any of such parties, be liable to any person for any indirect, special, incidental, or consequential damages of any character including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to you. +10. U.S. government end users + +The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. +11. Miscellaneous + +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. +12. Responsibility for claims + +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/README.md b/modules/AJCoreGUI/src/main/java/de/tklsoft/README.md new file mode 100755 index 00000000..8369c833 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/README.md @@ -0,0 +1,3 @@ +TKLControls +version: 1.0 +written by Torsten Krall and Timo Lövenich diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/DelegationObject.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/DelegationObject.java new file mode 100755 index 00000000..10b73513 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/DelegationObject.java @@ -0,0 +1,19 @@ +package de.tklsoft.gui.controls; + +import java.awt.Component; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +public abstract class DelegationObject { + + public static void notifyPapas(Component ersterPapa, KeyEvent keyEvent) { + for(Object moeglicherFrame = ersterPapa; moeglicherFrame != null; moeglicherFrame = ((Component)moeglicherFrame).getParent()) { + KeyListener[] listeners = ((Component)moeglicherFrame).getKeyListeners(); + + for(int i = 0; i < listeners.length; ++i) { + listeners[i].keyReleased(keyEvent); + } + } + + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/InvalidRule.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/InvalidRule.java new file mode 100755 index 00000000..082c077b --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/InvalidRule.java @@ -0,0 +1,51 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.ModifyableComponent; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JTextField; + +public interface InvalidRule { + + boolean isInvalid(ModifyableComponent var1); + + public static class NotEmptyInvalidRule implements InvalidRule { + + private static NotEmptyInvalidRule instance = null; + + + public static InvalidRule getInstance() { + if(instance == null) { + instance = new NotEmptyInvalidRule(); + } + + return instance; + } + + public boolean isInvalid(ModifyableComponent aComponent) { + JComponent component = aComponent.getComponent(); + return component instanceof JTextField?((JTextField)component).getText().length() > 0:(component instanceof JComboBox?((JComboBox)component).getSelectedItem() != null:true); + } + + } + + public static class EmptyInvalidRule implements InvalidRule { + + private static EmptyInvalidRule instance = null; + + + public static InvalidRule getInstance() { + if(instance == null) { + instance = new EmptyInvalidRule(); + } + + return instance; + } + + public boolean isInvalid(ModifyableComponent aComponent) { + JComponent component = aComponent.getComponent(); + return component instanceof JTextField?((JTextField)component).getText().length() == 0:(component instanceof JComboBox?((JComboBox)component).getSelectedItem() == null:true); + } + + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/ModifyableComponent.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/ModifyableComponent.java new file mode 100755 index 00000000..de581070 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/ModifyableComponent.java @@ -0,0 +1,39 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.InvalidRule; +import de.tklsoft.gui.controls.StatusHolder; +import java.beans.PropertyChangeListener; +import javax.swing.JComponent; + +public interface ModifyableComponent { + + void addStatusPropertyChangeListener(PropertyChangeListener var1); + + void removeStatusPropertyChangeListener(PropertyChangeListener var1); + + void addInvalidRule(InvalidRule var1); + + void removeInvalidRule(InvalidRule var1); + + void ignoreInvalidRules(boolean var1); + + void resetValidStatus(); + + void fireCheckRules(); + + boolean isInvalid(); + + void ignoreStatus(StatusHolder.STATUSFLAG var1, boolean var2); + + Object getOldValue(); + + void confirmNewValue(); + + JComponent getComponent(); + + boolean isDirty(); + + void resetToOldValue(); + + void disableDirtyComponent(boolean var1); +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/StatusHolder.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/StatusHolder.java new file mode 100755 index 00000000..192e6f7e --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/StatusHolder.java @@ -0,0 +1,144 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.InvalidRule; +import de.tklsoft.gui.controls.ModifyableComponent; +import de.tklsoft.gui.controls.border.ModifyableComponentBorder; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public class StatusHolder { + + private final ModifyableComponent parentComponent; + private HashSet ignoreStati = new HashSet(); + private STATUSFLAG status; + private ModifyableComponentBorder dirtyBorder; + private Set listeners; + private Set rules; + private boolean ignoreRules; + + + StatusHolder(ModifyableComponent component, int borderWidth) { + this.status = STATUSFLAG.NORMAL; + this.listeners = new HashSet(); + this.rules = new HashSet(); + this.ignoreRules = true; + this.parentComponent = component; + this.dirtyBorder = new ModifyableComponentBorder(component.getComponent(), borderWidth); + component.getComponent().setBorder(this.dirtyBorder); + this.addStatusPropertyChangeListener(this.dirtyBorder); + } + + public void setStatus(STATUSFLAG newStatus) { + PropertyChangeEvent ev = new PropertyChangeEvent(this.parentComponent, "border", this.status, newStatus); + this.status = newStatus; + this.informStatusPropertyChangeListeners(ev); + } + + public STATUSFLAG getStatus() { + return this.status; + } + + public void addStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.listeners.add(propertyChangeListener); + } + + public void removeStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.listeners.remove(propertyChangeListener); + } + + private void informStatusPropertyChangeListeners(PropertyChangeEvent ev) { + Iterator i$ = this.listeners.iterator(); + + while(i$.hasNext()) { + PropertyChangeListener curListener = (PropertyChangeListener)i$.next(); + curListener.propertyChange(ev); + } + + } + + public void addInvalidRule(InvalidRule rule) { + this.rules.add(rule); + } + + public void removeInvalidRule(InvalidRule rule) { + this.rules.remove(rule); + } + + public void ignoreInvalidRules(boolean ignore) { + this.ignoreRules = ignore; + } + + public boolean shouldIgnoreInvalidRules() { + return this.ignoreRules; + } + + public void resetValidStatus() { + this.setStatus(STATUSFLAG.NORMAL); + } + + public void ignoreStatus(STATUSFLAG status, boolean ignore) { + if(ignore) { + this.ignoreStati.add(status); + } else { + this.ignoreStati.remove(status); + } + + } + + public void fireCheckRules() { + if(this.ignoreRules) { + if(!this.ignoreStati.contains(STATUSFLAG.MODIFIED) && this.parentComponent.isDirty()) { + this.setStatus(STATUSFLAG.MODIFIED); + } else { + this.setStatus(STATUSFLAG.NORMAL); + } + + } else if(this.ignoreStati.contains(STATUSFLAG.INVALID)) { + this.setStatus(STATUSFLAG.NORMAL); + } else { + if(this.isInvalid()) { + this.setStatus(STATUSFLAG.INVALID); + } else if(!this.ignoreStati.contains(STATUSFLAG.MODIFIED) && this.parentComponent.isDirty()) { + this.setStatus(STATUSFLAG.MODIFIED); + } else { + this.setStatus(STATUSFLAG.NORMAL); + } + + } + } + + public boolean isInvalid() { + if(this.ignoreRules) { + return false; + } else { + Iterator i$ = this.rules.iterator(); + + InvalidRule curRule; + do { + if(!i$.hasNext()) { + return false; + } + + curRule = (InvalidRule)i$.next(); + } while(!curRule.isInvalid(this.parentComponent)); + + return true; + } + } + + public static enum STATUSFLAG { + + NORMAL("NORMAL", 0), + MODIFIED("MODIFIED", 1), + INVALID("INVALID", 2); + // $FF: synthetic field + private static final STATUSFLAG[] $VALUES = new STATUSFLAG[]{NORMAL, MODIFIED, INVALID}; + + + private STATUSFLAG(String var1, int var2) {} + + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLButton.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLButton.java new file mode 100755 index 00000000..3d0547b5 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLButton.java @@ -0,0 +1,55 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import de.tklsoft.gui.layout.Synchronizable; +import de.tklsoft.gui.layout.Synchronizer; +import java.awt.Dimension; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.Icon; +import javax.swing.JButton; + +public class TKLButton extends JButton implements Synchronizable { + + private Synchronizer synchronizer; + + + public TKLButton(String text, Icon icon) { + super(text, icon); + this.synchronizer = null; + this.init(); + } + + public TKLButton(String text) { + this(text, (Icon)null); + } + + public TKLButton(Icon icon) { + this("", icon); + } + + public TKLButton() { + this("", (Icon)null); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLButton.this.getParent(), keyEvent); + } + }); + } + + public void setSynchronizer(Synchronizer synchronizer) { + this.synchronizer = synchronizer; + } + + public Dimension getPreferredSize() { + return this.synchronizer == null?super.getPreferredSize():this.synchronizer.getSize(this); + } + + public Dimension getNormalSize() { + return super.getPreferredSize(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCalendarComboBox.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCalendarComboBox.java new file mode 100755 index 00000000..5583fef8 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCalendarComboBox.java @@ -0,0 +1,331 @@ +/* + * Decompiled with CFR 0.150. + */ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.calendar.JCalendarPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JSpinner; +import javax.swing.JTextField; +import javax.swing.JWindow; +import javax.swing.RootPaneContainer; +import javax.swing.SpinnerDateModel; +import javax.swing.SwingConstants; +import javax.swing.event.AncestorEvent; +import javax.swing.event.AncestorListener; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.plaf.basic.BasicArrowButton; + +public class TKLCalendarComboBox + extends JPanel + implements ActionListener, + AncestorListener, + ChangeListener, + SwingConstants { + private int _popupLocation = 2; + private boolean _calendarWindowFocusLost = false; + private Calendar _selected; + private BasicArrowButton _button; + private JSpinner _spinner = new JSpinner(); + private JWindow _calendarWindow; + private JCalendarPanel _calendarPanel; + private List<ChangeListener> _changeListener = new ArrayList<ChangeListener>(); + private boolean _fireingChangeEvent = false; + private boolean _changed = false; + + public TKLCalendarComboBox() { + this._calendarPanel = new JCalendarPanel(); + this.createGUI(); + } + + public TKLCalendarComboBox(Calendar cal) { + this._calendarPanel = new JCalendarPanel(cal); + this.createGUI(); + } + + private void createGUI() { + this._calendarPanel.setListenerModus(2); + this._selected = (Calendar)this._calendarPanel.getCalendar().clone(); + this._calendarPanel.addChangeListener(this); + this._calendarPanel.setBorder(BorderFactory.createLineBorder(Color.black)); + this.setLayout(new BorderLayout()); + this._spinner.setModel(new SpinnerDateModel()); + this._spinner.setEditor(new JSpinner.DateEditor(this._spinner, ((SimpleDateFormat)this._calendarPanel.getDateFormat()).toPattern())); + this._spinner.getModel().setValue(this._selected.getTime()); + this._spinner.setBorder(null); + ((JSpinner.DefaultEditor)this._spinner.getEditor()).getTextField().addFocusListener(new FocusAdapter(){ + + public void focusLost(FocusEvent e) { + if (!TKLCalendarComboBox.this._calendarPanel.getCalendar().getTime().equals(TKLCalendarComboBox.this._spinner.getModel().getValue())) { + Date date = (Date)TKLCalendarComboBox.this._spinner.getModel().getValue(); + TKLCalendarComboBox.this._selected.setTime(date); + TKLCalendarComboBox.this._calendarPanel.setCalendar(TKLCalendarComboBox.this._selected); + TKLCalendarComboBox.this.fireChangeEvent(); + } + } + }); + this._button = new BasicArrowButton(5); + Insets insets = new Insets(this._button.getMargin().top, 0, this._button.getMargin().bottom, 0); + this._button.setMargin(insets); + this._button.addActionListener(this); + this._button.setEnabled(true); + this._button.addFocusListener(new FocusAdapter(){ + + public void focusGained(FocusEvent e) { + JComponent opposite; + if (e.getOppositeComponent() != null && e.getOppositeComponent() instanceof JComponent && (opposite = (JComponent)e.getOppositeComponent()).getTopLevelAncestor() != TKLCalendarComboBox.this._calendarWindow && !TKLCalendarComboBox.this._calendarWindowFocusLost) { + TKLCalendarComboBox.this._calendarWindowFocusLost = false; + } + } + }); + this.add((Component)this._spinner, "Center"); + this.add((Component)this._button, "East"); + this.setBorder(new JTextField().getBorder()); + } + + public Dimension getPreferredSize() { + return new Dimension(120, super.getPreferredSize().height); + } + + private void createCalendarWindow() { + Window ancestor = (Window)this.getTopLevelAncestor(); + this._calendarWindow = new JWindow(ancestor); + JPanel contentPanel = (JPanel)this._calendarWindow.getContentPane(); + contentPanel.setLayout(new BorderLayout()); + contentPanel.add(this._calendarPanel); + ((JComponent)((RootPaneContainer)((Object)ancestor)).getContentPane()).addAncestorListener(this); + ((JComponent)((RootPaneContainer)((Object)ancestor)).getContentPane()).addMouseListener(new MouseAdapter(){ + + public void mouseClicked(MouseEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + }); + this._calendarWindow.addWindowListener(new WindowAdapter(){ + + public void windowDeactivated(WindowEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + }); + this._calendarWindow.addWindowFocusListener(new WindowAdapter(){ + + public void windowLostFocus(WindowEvent e) { + if (TKLCalendarComboBox.this._button.isSelected()) { + TKLCalendarComboBox.this._calendarWindowFocusLost = true; + } + TKLCalendarComboBox.this.hideCalendar(); + } + }); + ancestor.addComponentListener(new ComponentAdapter(){ + + public void componentResized(ComponentEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + + public void componentMoved(ComponentEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + + public void componentShown(ComponentEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + + public void componentHidden(ComponentEvent e) { + TKLCalendarComboBox.this.hideCalendar(); + } + }); + this._calendarWindow.pack(); + } + + public Calendar getCalendar() { + return this._calendarPanel.getCalendar(); + } + + public void setTime(long time) { + Calendar calendar = this._calendarPanel.getCalendar(); + calendar.setTimeInMillis(time); + this.setCalendar(calendar); + } + + public void setCalendar(Calendar cal) { + this._calendarPanel.setCalendar(cal); + this._spinner.getModel().setValue(this._calendarPanel.getCalendar().getTime()); + } + + public JCalendarPanel getCalendarPanel() { + return this._calendarPanel; + } + + public void setPopUpLocation(int location) { + this._popupLocation = location; + } + + public int getPopUpLocation() { + return this._popupLocation; + } + + public void setVerticalAlignment(int value) { + } + + public void setHorizontalAlignment(int value) { + ((JSpinner.DefaultEditor)this._spinner.getEditor()).getTextField().setHorizontalAlignment(value); + } + + public void actionPerformed(ActionEvent e) { + if (this._calendarWindow != null && this._calendarWindow.isVisible()) { + this.hideCalendar(); + } else { + this.showCalender(); + } + } + + public void hideCalendar() { + if (this._calendarWindow.isVisible()) { + this._calendarWindow.setVisible(false); + if (!this._calendarPanel.getCalendar().getTime().equals(this._spinner.getModel().getValue())) { + this._changed = true; + } + if (this._changed) { + this._spinner.getModel().setValue(this._calendarPanel.getCalendar().getTime()); + this._selected = (Calendar)this._calendarPanel.getCalendar().clone(); + this._changed = false; + this.fireChangeEvent(); + } + } + } + + public void showCalender() { + Window ancestor = (Window)this.getTopLevelAncestor(); + if (this._calendarWindow == null || ancestor != this._calendarWindow.getOwner()) { + this.createCalendarWindow(); + } + Date date = (Date)this._spinner.getModel().getValue(); + this._selected.setTime(date); + this._calendarPanel.setCalendar(this._selected); + Point location = this.getLocationOnScreen(); + int x = this._popupLocation == 4 ? (int)location.getX() + this._button.getSize().width - this._calendarWindow.getSize().width : (this._popupLocation == 0 ? (int)location.getX() + (this._button.getSize().width - this._calendarWindow.getSize().width) / 2 : (int)location.getX()); + int y = (int)location.getY() + this._button.getHeight(); + Rectangle screenSize = this.getDesktopBounds(); + if (x < 0) { + x = 0; + } + if (y < 0) { + y = 0; + } + if (x + this._calendarWindow.getWidth() > screenSize.width) { + x = screenSize.width - this._calendarWindow.getWidth(); + } + if (y + 30 + this._calendarWindow.getHeight() > screenSize.height) { + y = (int)location.getY() - this._calendarWindow.getHeight(); + } + this._calendarWindow.setBounds(x, y, this._calendarWindow.getWidth(), this._calendarWindow.getHeight()); + this._calendarWindow.setVisible(true); + } + + private Rectangle getDesktopBounds() { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice[] gd = ge.getScreenDevices(); + Rectangle[] screenDeviceBounds = new Rectangle[gd.length]; + Rectangle desktopBounds = new Rectangle(); + for (int i = 0; i < gd.length; ++i) { + GraphicsConfiguration gc = gd[i].getDefaultConfiguration(); + screenDeviceBounds[i] = gc.getBounds(); + desktopBounds = desktopBounds.union(screenDeviceBounds[i]); + } + return desktopBounds; + } + + public void ancestorAdded(AncestorEvent event) { + this.hideCalendar(); + } + + public void ancestorMoved(AncestorEvent event) { + this.hideCalendar(); + } + + public void ancestorRemoved(AncestorEvent event) { + this.hideCalendar(); + } + + public void stateChanged(ChangeEvent e) { + this._changed = true; + this.hideCalendar(); + } + + public void addChangeListener(ChangeListener listener) { + this._changeListener.add(listener); + } + + public void removeChangeListener(ChangeListener listener) { + this._changeListener.remove(listener); + } + + public ChangeListener[] getChangeListener() { + return (ChangeListener[])this._changeListener.toArray(); + } + + protected void fireChangeEvent() { + if (!this._fireingChangeEvent) { + this._fireingChangeEvent = true; + ChangeEvent event = new ChangeEvent(this); + for (ChangeListener cl : this._changeListener) { + cl.stateChanged(event); + } + this._fireingChangeEvent = false; + } + } + + public void setEnabled(boolean enabled) { + this._spinner.setEnabled(enabled); + this._button.setEnabled(enabled); + } + + public boolean isEnabled() { + return this._button.isEnabled(); + } + + public int getPopupLocation() { + return this._popupLocation; + } + + public void setPopupLocation(int location) { + this._popupLocation = location; + } + + public SpinnerDateModel getModel() { + return (SpinnerDateModel)this._spinner.getModel(); + } + + public void setSpinnerDateModel(SpinnerDateModel model) { + this._spinner.setModel(model); + } +} + diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCheckBox.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCheckBox.java new file mode 100755 index 00000000..fcea0da6 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLCheckBox.java @@ -0,0 +1,130 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import de.tklsoft.gui.controls.InvalidRule; +import de.tklsoft.gui.controls.ModifyableComponent; +import de.tklsoft.gui.controls.StatusHolder; +import de.tklsoft.gui.layout.Synchronizable; +import de.tklsoft.gui.layout.Synchronizer; +import java.awt.Dimension; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeListener; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +public class TKLCheckBox extends JCheckBox implements ModifyableComponent, Synchronizable { + + private Synchronizer synchronizer; + private StatusHolder statusHolder; + private boolean oldValue; + + + public TKLCheckBox(String text, boolean selected) { + super(text, selected); + this.synchronizer = null; + this.oldValue = selected; + this.init(); + } + + public TKLCheckBox() { + this("", false); + } + + public TKLCheckBox(String text) { + this(text, false); + } + + private void init() { + this.statusHolder = new StatusHolder(this, 13); + this.setBorderPainted(true); + this.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent ce) { + TKLCheckBox.this.fireCheckRules(); + } + }); + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLCheckBox.this.getParent(), keyEvent); + TKLCheckBox.this.fireCheckRules(); + } + }); + } + + public void setSynchronizer(Synchronizer synchronizer) { + this.synchronizer = synchronizer; + } + + public Dimension getPreferredSize() { + return this.synchronizer == null?super.getPreferredSize():this.synchronizer.getSize(this); + } + + public Dimension getNormalSize() { + return super.getPreferredSize(); + } + + public void addStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.addStatusPropertyChangeListener(propertyChangeListener); + } + + public void removeStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.removeStatusPropertyChangeListener(propertyChangeListener); + } + + public void addInvalidRule(InvalidRule rule) { + this.statusHolder.addInvalidRule(rule); + } + + public void removeInvalidRule(InvalidRule rule) { + this.statusHolder.removeInvalidRule(rule); + } + + public void ignoreInvalidRules(boolean ignore) { + this.statusHolder.ignoreInvalidRules(ignore); + } + + public void ignoreStatus(StatusHolder.STATUSFLAG statusFlag, boolean ignore) { + this.statusHolder.ignoreStatus(statusFlag, ignore); + } + + public void resetValidStatus() { + this.statusHolder.resetValidStatus(); + } + + public void fireCheckRules() { + this.statusHolder.fireCheckRules(); + } + + public boolean isInvalid() { + return this.statusHolder.isInvalid(); + } + + public Object getOldValue() { + return new Boolean(this.oldValue); + } + + public void confirmNewValue() { + this.oldValue = this.isSelected(); + this.statusHolder.fireCheckRules(); + } + + public JComponent getComponent() { + return this; + } + + public boolean isDirty() { + return this.oldValue != this.isSelected(); + } + + public void resetToOldValue() { + this.setSelected(this.oldValue); + } + + public void disableDirtyComponent(boolean disable) { + this.statusHolder.ignoreStatus(StatusHolder.STATUSFLAG.MODIFIED, disable); + this.statusHolder.fireCheckRules(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLComboBox.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLComboBox.java new file mode 100755 index 00000000..78a8577d --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLComboBox.java @@ -0,0 +1,153 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import de.tklsoft.gui.controls.InvalidRule; +import de.tklsoft.gui.controls.ModifyableComponent; +import de.tklsoft.gui.controls.StatusHolder; +import de.tklsoft.gui.layout.Synchronizable; +import de.tklsoft.gui.layout.Synchronizer; +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeListener; +import javax.swing.JComboBox; +import javax.swing.JComponent; + +public class TKLComboBox extends JComboBox implements ModifyableComponent, Synchronizable { + + private Synchronizer synchronizer; + private StatusHolder statusHolder; + private Object oldValue; + + + public TKLComboBox(Object[] data) { + super(data); + this.synchronizer = null; + this.oldValue = null; + this.init(); + } + + public TKLComboBox() { + this(new Object[0]); + } + + private void init() { + this.statusHolder = new StatusHolder(this, -1); + this.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + if(e.getStateChange() == 1) { + TKLComboBox.this.fireCheckRules(); + } + + } + }); + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLComboBox.this.getParent(), keyEvent); + } + }); + } + + public void setSelectedItem(Object anObject, boolean ignoreInvalidRules) { + if(ignoreInvalidRules && !this.statusHolder.shouldIgnoreInvalidRules()) { + this.ignoreInvalidRules(true); + super.setSelectedItem(anObject); + this.ignoreInvalidRules(false); + } else { + super.setSelectedItem(anObject); + } + + } + + public void setSelectedItem(Object anObject) { + this.setSelectedItem(anObject, false); + } + + public void addItem(Object anObject) { + if(this.statusHolder.shouldIgnoreInvalidRules()) { + super.addItem(anObject); + } else { + this.ignoreInvalidRules(true); + super.addItem(anObject); + this.ignoreInvalidRules(false); + } + + } + + public void addStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.addStatusPropertyChangeListener(propertyChangeListener); + } + + public void removeStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.removeStatusPropertyChangeListener(propertyChangeListener); + } + + public void addInvalidRule(InvalidRule rule) { + this.statusHolder.addInvalidRule(rule); + } + + public void removeInvalidRule(InvalidRule rule) { + this.statusHolder.removeInvalidRule(rule); + } + + public void ignoreInvalidRules(boolean ignore) { + this.statusHolder.ignoreInvalidRules(ignore); + } + + public void ignoreStatus(StatusHolder.STATUSFLAG statusFlag, boolean ignore) { + this.statusHolder.ignoreStatus(statusFlag, ignore); + } + + public void resetValidStatus() { + this.statusHolder.resetValidStatus(); + } + + public void fireCheckRules() { + this.statusHolder.fireCheckRules(); + } + + public boolean isInvalid() { + return this.statusHolder.isInvalid(); + } + + public void setSynchronizer(Synchronizer synchronizer) { + this.synchronizer = synchronizer; + } + + public Dimension getPreferredSize() { + return this.synchronizer == null?super.getPreferredSize():this.synchronizer.getSize(this); + } + + public Dimension getNormalSize() { + return super.getPreferredSize(); + } + + public Object getOldValue() { + return this.oldValue; + } + + public void confirmNewValue() { + this.oldValue = this.getSelectedItem(); + this.statusHolder.fireCheckRules(); + } + + public JComponent getComponent() { + return this; + } + + public boolean isDirty() { + return this.oldValue != this.getSelectedItem(); + } + + public void resetToOldValue() { + this.setSelectedItem(this.oldValue); + } + + public void disableDirtyComponent(boolean disable) { + this.statusHolder.ignoreStatus(StatusHolder.STATUSFLAG.MODIFIED, disable); + this.statusHolder.fireCheckRules(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLDesktopPane.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLDesktopPane.java new file mode 100755 index 00000000..f2ab7b63 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLDesktopPane.java @@ -0,0 +1,36 @@ +package de.tklsoft.gui.controls; + +import java.awt.Dimension; +import java.awt.Rectangle; +import javax.swing.JDesktopPane; + +public class TKLDesktopPane extends JDesktopPane { + + private int x = 20; + private int xModifier = 0; + private int y = 20; + private Dimension dim = null; + private int width; + private int height; + + + public Rectangle getPreferredPanelRectangle() { + if(this.dim == null) { + this.dim = this.getSize(); + this.width = this.dim.width; + this.height = this.dim.height; + } else { + this.dim = this.getSize(); + } + + if(this.x > this.width / 2 || this.y > this.height / 2) { + this.xModifier += 20; + this.x = 20 + this.xModifier; + this.y = 20; + } + + this.x += 30; + this.y += 30; + return new Rectangle(this.x, this.y, this.width / 3 * 2, this.height / 3 * 2); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorMainMenu.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorMainMenu.java new file mode 100755 index 00000000..b25d5301 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorMainMenu.java @@ -0,0 +1,228 @@ +/* + * Decompiled with CFR 0.150. + */ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.TKLFloorTab; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashMap; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; + +public class TKLFloorMainMenu { + private JButton northButton; + private JButton southButton; + private MenuPanel menuPanel; + private String name; + private TKLFloorTab parent; + + public TKLFloorMainMenu(TKLFloorTab parent, String name) { + this.name = name.toLowerCase(); + this.parent = parent; + this.northButton = new JButton(name); + this.northButton.setBorderPainted(false); + this.northButton.setBackground(Color.LIGHT_GRAY); + this.southButton = new JButton(name); + this.southButton.setBorderPainted(false); + this.southButton.setBackground(Color.LIGHT_GRAY); + MenuButtonListener actionListener = new MenuButtonListener(name, this); + this.northButton.addActionListener(actionListener); + this.southButton.addActionListener(actionListener); + this.menuPanel = new MenuPanel(); + } + + public String getName() { + return this.name; + } + + public void setName(String newName) { + this.northButton.setText(newName); + this.southButton.setText(newName); + } + + JButton getNorthButton() { + return this.northButton; + } + + JButton getSouthButton() { + return this.southButton; + } + + MenuPanel getMenuPanel() { + return this.menuPanel; + } + + public TklFloorButton addIcon(String name, Icon icon, ActionListener actionListener) { + if (this.menuPanel != null) { + return this.menuPanel.addButton(name, icon, actionListener); + } + return null; + } + + private class MenuPanel + extends JPanel { + private GridBagConstraints gridconst = new GridBagConstraints(); + private int currentMaxY = -1; + private HashMap<String, ButtonPanel> buttons = new HashMap(); + + public MenuPanel() { + this.setLayout(new GridBagLayout()); + this.gridconst.anchor = 11; + this.gridconst.fill = 2; + this.gridconst.insets = new Insets(0, 0, 0, 0); + this.gridconst.weightx = 1.0; + this.gridconst.weighty = 0.0; + this.gridconst.gridx = 0; + this.gridconst.weighty = 1.0; + this.gridconst.gridy = 251; + this.add((Component)new JLabel(), this.gridconst); + this.gridconst.weighty = 0.0; + } + + void renameButton(String oldValue, String newValue) { + ButtonPanel obj = this.buttons.get(oldValue); + if (obj != null) { + this.buttons.remove(oldValue); + this.buttons.put(newValue, obj); + } + } + + public TklFloorButton addButton(String name, Icon icon, ActionListener actionListener) { + if (name == null || name.length() == 0) { + throw new RuntimeException("Ung\u00fcltiger Name!"); + } + if (icon == null) { + throw new RuntimeException("Ung\u00fcltiges Icon!"); + } + if (actionListener == null) { + throw new RuntimeException("Ung\u00fcltiger ActionListener!"); + } + if (this.buttons.containsKey(name.toLowerCase())) { + throw new RuntimeException("Buttonname '" + name + "' bereits definiert!"); + } + ButtonPanel buttonPanel = new ButtonPanel(name, icon, actionListener); + this.buttons.put(name, buttonPanel); + if (this.currentMaxY >= 249) { + throw new RuntimeException("Maximal 250 Men\u00fceintr\u00e4ge m\u00f6glich!"); + } + ++this.currentMaxY; + this.gridconst.gridy = this.currentMaxY; + this.add((Component)buttonPanel, this.gridconst); + return new TklFloorButton(this, buttonPanel); + } + } + + private class MenuButtonListener + implements ActionListener { + private final String name; + private final TKLFloorMainMenu tKLFloorMainMenu; + + public MenuButtonListener(String name, TKLFloorMainMenu tKLFloorMainMenu2) { + this.name = name.toLowerCase(); + this.tKLFloorMainMenu = tKLFloorMainMenu2; + } + + public void actionPerformed(ActionEvent e) { + TKLFloorMainMenu.this.parent.showMenu(this.tKLFloorMainMenu); + } + } + + private class ButtonPanel + extends JPanel { + private JLabel buttonLabel; + + ButtonPanel(String name, Icon icon, ActionListener actionListener) { + super(new GridBagLayout()); + JLabel button = new JLabel(icon); + button.setPreferredSize(new Dimension(48, 48)); + button.setMinimumSize(new Dimension(48, 48)); + button.addMouseListener(new MouseOverAdapter(actionListener, name)); + button.setBorder(BorderFactory.createLineBorder(button.getBackground())); + GridBagConstraints gridconstint = new GridBagConstraints(); + gridconstint.anchor = 11; + gridconstint.fill = 2; + gridconstint.insets = new Insets(10, 5, 0, 5); + gridconstint.weightx = 1.0; + gridconstint.weighty = 0.0; + gridconstint.gridx = 0; + this.add((Component)new JLabel(), gridconstint); + gridconstint.weightx = 0.0; + gridconstint.gridx = 1; + this.add((Component)button, gridconstint); + gridconstint.gridx = 2; + gridconstint.weightx = 1.0; + this.add((Component)new JLabel(), gridconstint); + gridconstint.weightx = 0.0; + gridconstint.gridx = 0; + gridconstint.gridy = 1; + gridconstint.gridwidth = 3; + gridconstint.insets.top = 0; + this.buttonLabel = new JLabel(name, 0); + this.add((Component)this.buttonLabel, gridconstint); + } + + String getButtonText() { + return this.buttonLabel.getText(); + } + + void setButtonText(String newText) { + this.buttonLabel.setText(newText); + } + } + + private class MouseOverAdapter + extends MouseAdapter { + private ActionListener actionListener; + private String name; + + public MouseOverAdapter(ActionListener actionListener, String name) { + this.actionListener = actionListener; + this.name = name; + } + + public void mouseEntered(MouseEvent e) { + JLabel source = (JLabel)e.getSource(); + source.setBorder(BorderFactory.createLineBorder(Color.black)); + } + + public void mouseClicked(MouseEvent e) { + JLabel source = (JLabel)e.getSource(); + if (this.actionListener != null) { + this.actionListener.actionPerformed(new ActionEvent(source, 0, this.name)); + } + } + + public void mouseExited(MouseEvent e) { + JLabel source = (JLabel)e.getSource(); + source.setBorder(BorderFactory.createLineBorder(source.getBackground())); + } + } + + public class TklFloorButton { + private final ButtonPanel buttonPanel; + private final MenuPanel parent; + + TklFloorButton(MenuPanel parent, ButtonPanel buttonPanel) { + this.buttonPanel = buttonPanel; + this.parent = parent; + } + + public void setText(String newText) { + this.parent.renameButton(this.buttonPanel.getButtonText(), newText); + this.buttonPanel.setButtonText(newText); + } + } +} + diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorTab.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorTab.java new file mode 100755 index 00000000..30173442 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFloorTab.java @@ -0,0 +1,107 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.TKLFloorMainMenu; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import javax.swing.JButton; +import javax.swing.JPanel; + +public class TKLFloorTab extends JPanel { + + private ArrayList buttons = new ArrayList(); + private JPanel northPanel = new JPanel(new GridBagLayout()); + private JPanel southPanel = new JPanel(new GridBagLayout()); + private CardLayout cardLayout = new CardLayout(); + private JPanel centerPanel; + private ArrayList mainMenuButtons; + private HashMap yIndizes; + private GridBagConstraints constraints; + private int maxY; + + + public TKLFloorTab() { + this.centerPanel = new JPanel(this.cardLayout); + this.mainMenuButtons = new ArrayList(); + this.yIndizes = new HashMap(); + this.constraints = new GridBagConstraints(); + this.maxY = -1; + this.setLayout(new BorderLayout()); + this.add(this.northPanel, "North"); + this.add(this.southPanel, "South"); + this.add(this.centerPanel, "Center"); + this.constraints.anchor = 11; + this.constraints.fill = 1; + this.constraints.insets = new Insets(0, 0, 0, 0); + this.constraints.weightx = 1.0D; + this.constraints.weighty = 0.0D; + this.constraints.gridx = 0; + } + + public void showMenu(TKLFloorMainMenu tKLFloorMainMenu) { + String name = tKLFloorMainMenu.getName(); + if(name != null && name.length() != 0) { + Integer indexTmp = (Integer)this.yIndizes.get(name.toLowerCase()); + if(indexTmp != null) { + int index = indexTmp.intValue(); + + for(int i = 0; i < this.yIndizes.size(); ++i) { + JButton northButton = ((TKLFloorMainMenu)this.mainMenuButtons.get(i)).getNorthButton(); + northButton.setSelected(false); + JButton southButton = ((TKLFloorMainMenu)this.mainMenuButtons.get(i)).getSouthButton(); + southButton.setSelected(false); + if(i <= index) { + northButton.setVisible(true); + if(i != index) { + northButton.setBackground(Color.LIGHT_GRAY); + } else { + northButton.setBackground(Color.WHITE); + } + + southButton.setVisible(false); + } else { + northButton.setVisible(false); + southButton.setVisible(true); + } + } + + this.cardLayout.show(this.centerPanel, name.toLowerCase()); + } + + } + } + + public void addMenu(TKLFloorMainMenu tKLFloorMainMenu) { + String name = tKLFloorMainMenu.getName(); + int size = this.mainMenuButtons.size(); + Iterator northButton = this.mainMenuButtons.iterator(); + + TKLFloorMainMenu southButton; + do { + if(!northButton.hasNext()) { + JButton northButton1 = tKLFloorMainMenu.getNorthButton(); + JButton southButton1 = tKLFloorMainMenu.getSouthButton(); + ++this.maxY; + this.constraints.gridy = this.maxY; + northButton1.setVisible(false); + this.northPanel.add(northButton1, this.constraints); + this.southPanel.add(southButton1, this.constraints); + northButton1.setVisible(false); + this.mainMenuButtons.add(tKLFloorMainMenu); + this.yIndizes.put(name.toLowerCase(), new Integer(this.maxY)); + this.centerPanel.add(name.toLowerCase(), tKLFloorMainMenu.getMenuPanel()); + return; + } + + southButton = (TKLFloorMainMenu)northButton.next(); + } while(!southButton.getName().equalsIgnoreCase(name)); + + throw new RuntimeException("Menüname \'" + name + "\' bereits definiert!"); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFrame.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFrame.java new file mode 100755 index 00000000..3c24a76d --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLFrame.java @@ -0,0 +1,39 @@ +package de.tklsoft.gui.controls; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import javax.swing.JFrame; + +public class TKLFrame extends JFrame { + + private WindowListener closeWindowListener; + + + public TKLFrame() { + this(""); + } + + public TKLFrame(String title) { + super(title); + this.closeWindowListener = new WindowAdapter() { + public void windowClosing(WindowEvent e) { + TKLFrame.this.closeFrame(0); + } + }; + this.addWindowListener(this.closeWindowListener); + } + + protected void closeFrame(int i) { + System.exit(i); + } + + public void enableCloseWindowListener(boolean enable) { + if(enable) { + this.addWindowListener(this.closeWindowListener); + } else { + this.removeWindowListener(this.closeWindowListener); + } + + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLLabel.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLLabel.java new file mode 100755 index 00000000..ca7d93d3 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLLabel.java @@ -0,0 +1,41 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JLabel; + +public class TKLLabel extends JLabel { + + public TKLLabel(String text, Icon image) { + super(text, image, 0); + this.init(); + } + + public TKLLabel(String text) { + this(text, (Icon)null); + } + + public TKLLabel(Icon image) { + this("", image); + } + + public TKLLabel() { + this("", (Icon)null); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLLabel.this.getParent(), keyEvent); + } + }); + } + + public void enableBorder() { + this.setBorder(BorderFactory.createEtchedBorder()); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPanel.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPanel.java new file mode 100755 index 00000000..258bcf31 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPanel.java @@ -0,0 +1,13 @@ +package de.tklsoft.gui.controls; + +import java.awt.LayoutManager; +import javax.swing.JPanel; + +public class TKLPanel extends JPanel { + + public TKLPanel() {} + + public TKLPanel(LayoutManager layoutManager) { + super(layoutManager); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPasswordField.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPasswordField.java new file mode 100755 index 00000000..275f48f1 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLPasswordField.java @@ -0,0 +1,50 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import de.tklsoft.gui.layout.Synchronizable; +import de.tklsoft.gui.layout.Synchronizer; +import java.awt.Dimension; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.JPasswordField; + +public class TKLPasswordField extends JPasswordField implements Synchronizable { + + private Synchronizer synchronizer = null; + private boolean dirty = false; + + + public TKLPasswordField() { + this.init(); + } + + public boolean isDirty() { + return this.dirty; + } + + public void resetDirtyFlag() { + this.dirty = false; + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + TKLPasswordField.this.dirty = true; + DelegationObject.notifyPapas(TKLPasswordField.this.getParent(), keyEvent); + } + }); + } + + public void setSynchronizer(Synchronizer synchronizer) { + this.synchronizer = synchronizer; + } + + public Dimension getPreferredSize() { + return this.synchronizer == null?super.getPreferredSize():this.synchronizer.getSize(this); + } + + public Dimension getNormalSize() { + return super.getPreferredSize(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLRadioButton.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLRadioButton.java new file mode 100755 index 00000000..dddd43dc --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLRadioButton.java @@ -0,0 +1,23 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.JRadioButton; + +public class TKLRadioButton extends JRadioButton { + + public TKLRadioButton(String schluesselname) { + super(schluesselname); + this.init(); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLRadioButton.this.getParent(), keyEvent); + } + }); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLSlider.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLSlider.java new file mode 100755 index 00000000..f9111bf1 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLSlider.java @@ -0,0 +1,23 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.JSlider; + +public class TKLSlider extends JSlider { + + public TKLSlider(int min, int max, int value) { + super(min, max, value); + this.init(); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLSlider.this.getParent(), keyEvent); + } + }); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTable.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTable.java new file mode 100755 index 00000000..07053118 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTable.java @@ -0,0 +1,28 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.JTable; +import javax.swing.table.TableModel; + +public class TKLTable extends JTable { + + public TKLTable() { + this.init(); + } + + public TKLTable(TableModel tableModel) { + super(tableModel); + this.init(); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLTable.this.getParent(), keyEvent); + } + }); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextArea.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextArea.java new file mode 100755 index 00000000..c15b3b79 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextArea.java @@ -0,0 +1,32 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.controls.DelegationObject; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.BorderFactory; +import javax.swing.JTextArea; + +public class TKLTextArea extends JTextArea { + + public TKLTextArea(String text) { + super(text); + this.init(); + } + + public TKLTextArea() { + this(""); + } + + private void init() { + this.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLTextArea.this.getParent(), keyEvent); + } + }); + } + + public void enableBorder() { + this.setBorder(BorderFactory.createEtchedBorder()); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextField.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextField.java new file mode 100755 index 00000000..5a2089fd --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/TKLTextField.java @@ -0,0 +1,126 @@ +package de.tklsoft.gui.controls; + +import de.tklsoft.gui.layout.Synchronizable; +import de.tklsoft.gui.layout.Synchronizer; +import java.awt.Dimension; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeListener; +import javax.swing.JComponent; +import javax.swing.JTextField; +import javax.swing.KeyStroke; + +public class TKLTextField extends JTextField implements ModifyableComponent, Synchronizable { + + private Synchronizer synchronizer = null; + private StatusHolder statusHolder; + private String oldValue = ""; + + + public TKLTextField() { + this.init(); + } + + public TKLTextField(int columncount) { + super(columncount); + this.init(); + } + + public TKLTextField(String text) { + super(text); + this.oldValue = text; + this.init(); + } + + private void init() { + KeyStroke undo = KeyStroke.getKeyStroke(90, 2); + this.statusHolder = new StatusHolder(this, -1); + this.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + if(e.isControlDown() && e.getKeyCode() == 90) { + TKLTextField.this.setText(TKLTextField.this.oldValue); + } + + } + public void keyReleased(KeyEvent keyEvent) { + super.keyReleased(keyEvent); + DelegationObject.notifyPapas(TKLTextField.this.getParent(), keyEvent); + TKLTextField.this.fireCheckRules(); + } + }); + } + + public void addStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.addStatusPropertyChangeListener(propertyChangeListener); + } + + public void removeStatusPropertyChangeListener(PropertyChangeListener propertyChangeListener) { + this.statusHolder.removeStatusPropertyChangeListener(propertyChangeListener); + } + + public void addInvalidRule(InvalidRule rule) { + this.statusHolder.addInvalidRule(rule); + } + + public void removeInvalidRule(InvalidRule rule) { + this.statusHolder.removeInvalidRule(rule); + } + + public void ignoreInvalidRules(boolean ignore) { + this.statusHolder.ignoreInvalidRules(ignore); + } + + public void ignoreStatus(StatusHolder.STATUSFLAG statusFlag, boolean ignore) { + this.statusHolder.ignoreStatus(statusFlag, ignore); + } + + public void resetValidStatus() { + this.statusHolder.resetValidStatus(); + } + + public void fireCheckRules() { + this.statusHolder.fireCheckRules(); + } + + public boolean isInvalid() { + return this.statusHolder.isInvalid(); + } + + public void setSynchronizer(Synchronizer synchronizer) { + this.synchronizer = synchronizer; + } + + public Dimension getPreferredSize() { + return this.synchronizer == null?super.getPreferredSize():this.synchronizer.getSize(this); + } + + public Dimension getNormalSize() { + return super.getPreferredSize(); + } + + public Object getOldValue() { + return this.oldValue; + } + + public void confirmNewValue() { + this.oldValue = this.getText(); + this.statusHolder.fireCheckRules(); + } + + public void resetToOldValue() { + this.setText(this.oldValue); + } + + public JComponent getComponent() { + return this; + } + + public boolean isDirty() { + return !this.oldValue.equals(this.getText()); + } + + public void disableDirtyComponent(boolean disable) { + this.statusHolder.ignoreStatus(StatusHolder.STATUSFLAG.MODIFIED, disable); + this.statusHolder.fireCheckRules(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/border/ModifyableComponentBorder.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/border/ModifyableComponentBorder.java new file mode 100755 index 00000000..9fcd2795 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/border/ModifyableComponentBorder.java @@ -0,0 +1,118 @@ +/* + * Decompiled with CFR 0.150. + */ +package de.tklsoft.gui.controls.border; + +import de.tklsoft.gui.controls.StatusHolder; +import de.tklsoft.icon.IconManager; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.Timer; +import javax.swing.border.AbstractBorder; +import javax.swing.border.Border; + +public class ModifyableComponentBorder + extends AbstractBorder + implements PropertyChangeListener { + public static final String BORDER_STATUS_CHANGED = "border"; + private static Icon invalidIcon = IconManager.getInstance().getIcon("border_invalid"); + private final JComponent parentComponent; + private final Insets insets; + private int[] colors = new int[]{255, 0, 0}; + private Color currentColor = new Color(this.colors[0], this.colors[1], this.colors[2]); + private Border notDirtyBorder; + private int increment = 20; + private Timer timer; + private StatusHolder.STATUSFLAG status = StatusHolder.STATUSFLAG.NORMAL; + private Color modifiedColor = Color.BLUE; + private final int borderWidth; + private boolean hasToEnableBorder = false; + + public ModifyableComponentBorder(JComponent parentComponent, int borderWidth) { + this.parentComponent = parentComponent; + this.borderWidth = borderWidth; + this.notDirtyBorder = parentComponent.getBorder(); + if (this.notDirtyBorder != null) { + this.insets = this.notDirtyBorder.getBorderInsets(parentComponent); + this.hasToEnableBorder = true; + } else { + this.notDirtyBorder = BorderFactory.createLineBorder(parentComponent.getBackground(), 2); + this.insets = new Insets(1, 1, 1, 1); + } + this.init(); + } + + public ModifyableComponentBorder(JComponent parentComponent) { + this(parentComponent, -1); + } + + private void init() { + this.timer = new Timer(100, new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + if (ModifyableComponentBorder.this.parentComponent.isShowing()) { + ModifyableComponentBorder.this.currentColor = new Color(ModifyableComponentBorder.this.colors[0], ModifyableComponentBorder.this.colors[1], ModifyableComponentBorder.this.colors[2]); + int[] arrn = ModifyableComponentBorder.this.colors; + arrn[1] = arrn[1] + ModifyableComponentBorder.this.increment; + int[] arrn2 = ModifyableComponentBorder.this.colors; + arrn2[2] = arrn2[2] + ModifyableComponentBorder.this.increment; + if (ModifyableComponentBorder.this.colors[1] >= 240 || ModifyableComponentBorder.this.colors[1] == 0) { + ModifyableComponentBorder.this.increment = -ModifyableComponentBorder.this.increment; + } + ModifyableComponentBorder.this.parentComponent.repaint(); + } + } + }); + } + + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { + if (this.status == StatusHolder.STATUSFLAG.NORMAL) { + this.notDirtyBorder.paintBorder(c, g, x, y, width, height); + } else if (this.status == StatusHolder.STATUSFLAG.MODIFIED) { + this.drawBorder(this.modifiedColor, g, x, y, this.borderWidth == -1 ? width : this.borderWidth, height); + } else { + this.drawBorder(this.currentColor, g, x, y, this.borderWidth == -1 ? width : this.borderWidth, height); + invalidIcon.paintIcon(c, g, width - invalidIcon.getIconWidth() - this.insets.right - 2, this.insets.top + 2); + } + } + + private void drawBorder(Color color, Graphics g, int x, int y, int width, int height) { + Color tmpcolor = g.getColor(); + g.setColor(color); + g.drawRect(x, y, width - 1, height - 1); + g.drawRect(x + 1, y + 1, width - 3, height - 3); + g.setColor(tmpcolor); + } + + public Insets getBorderInsets(Component c) { + if (this.status == StatusHolder.STATUSFLAG.NORMAL) { + return this.notDirtyBorder.getBorderInsets(c); + } + if (this.status == StatusHolder.STATUSFLAG.MODIFIED) { + return this.insets; + } + return this.insets; + } + + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getSource() == this.parentComponent && evt.getPropertyName().equals(BORDER_STATUS_CHANGED)) { + this.status = (StatusHolder.STATUSFLAG)((Object)evt.getNewValue()); + if (this.status == StatusHolder.STATUSFLAG.INVALID && !this.timer.isRunning()) { + this.timer.start(); + } else if (this.status != StatusHolder.STATUSFLAG.INVALID && this.timer.isRunning()) { + this.timer.stop(); + } + this.parentComponent.repaint(); + } + } +} + diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/DayLabel.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/DayLabel.java new file mode 100755 index 00000000..377d345d --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/DayLabel.java @@ -0,0 +1,63 @@ +package de.tklsoft.gui.controls.calendar; + +import de.tklsoft.gui.controls.calendar.FlatButton; +import de.tklsoft.gui.controls.calendar.JMonthPanel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.BorderFactory; +import javax.swing.border.Border; + +public class DayLabel extends FlatButton implements ActionListener { + + private boolean _today; + private JMonthPanel _monthPanel; + private int _day; + private boolean _selected = false; + + + public DayLabel(int day, boolean today, JMonthPanel monthPanel) { + super(Integer.toString(day)); + this._today = today; + if(this._today) { + super.setBorder(BorderFactory.createEtchedBorder()); + } + + this.setBackground(JMonthPanel.BACKGROUND_COLOR); + this.addActionListener(this); + this._day = day; + this._monthPanel = monthPanel; + this.setHorizontalAlignment(4); + } + + public void setBorder(Border border) { + if(this._today) { + super.setBorder(BorderFactory.createEtchedBorder()); + } else { + super.setBorder(border); + } + + } + + public void setSelected(boolean selected) { + this._selected = selected; + if(this._selected) { + this.setOpaque(true); + this.setBackground(JMonthPanel.SELECTED_BACKGROUND_COLOR); + this.setForeground(JMonthPanel.SELECTED_FONT_COLOR); + } else { + this.setOpaque(false); + this.setBackground(JMonthPanel.BACKGROUND_COLOR); + this.setForeground(JMonthPanel.FONT_COLOR); + } + + } + + public boolean isSelected() { + return this._selected; + } + + public void actionPerformed(ActionEvent e) { + this._monthPanel.setSelectedDayOfMonth(this._day); + this.requestFocus(); + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/FlatButton.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/FlatButton.java new file mode 100755 index 00000000..e7af62a6 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/FlatButton.java @@ -0,0 +1,52 @@ +package de.tklsoft.gui.controls.calendar; + +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.UIManager; +import javax.swing.border.Border; + +public class FlatButton extends JButton implements FocusListener, MouseListener { + + private Border _focus = BorderFactory.createEtchedBorder(); + private Border _withoutfocus = BorderFactory.createEmptyBorder(2, 2, 2, 2); + + + public FlatButton(String text) { + super(text); + this.setBorder(this._withoutfocus); + if(UIManager.getLookAndFeel().getClass().toString().startsWith("class com.jgoodies")) { + this.setOpaque(false); + } else { + this.setContentAreaFilled(false); + } + + this.addFocusListener(this); + this.addMouseListener(this); + } + + public void focusGained(FocusEvent e) { + this.setBorder(this._focus); + } + + public void focusLost(FocusEvent e) { + this.setBorder(this._withoutfocus); + } + + public void mouseClicked(MouseEvent e) {} + + public void mouseEntered(MouseEvent e) { + this.setBorder(this._focus); + } + + public void mouseExited(MouseEvent e) { + this.setBorder(this._withoutfocus); + } + + public void mousePressed(MouseEvent e) {} + + public void mouseReleased(MouseEvent e) {} +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarDialog.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarDialog.java new file mode 100755 index 00000000..ff2b412f --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarDialog.java @@ -0,0 +1,78 @@ +package de.tklsoft.gui.controls.calendar; + +import de.tklsoft.gui.controls.TKLCalendarComboBox; +import java.awt.Component; +import java.awt.FlowLayout; +import java.util.Calendar; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; + +public class JCalendarDialog { + + private Component _parentComponent; + private String _title; + private String _message; + private TKLCalendarComboBox _calendarBox; + private int _optionType; + private int _messageType; + + + public JCalendarDialog(Component parentComponent, String title, String message) { + this._parentComponent = parentComponent; + this._title = title; + this._message = message; + this._calendarBox = new TKLCalendarComboBox(); + this._optionType = 2; + this._messageType = 3; + } + + public JCalendarDialog(Component parentComponent, String title, String message, TKLCalendarComboBox calendarBox) { + this._parentComponent = parentComponent; + this._title = title; + this._message = message; + this._calendarBox = calendarBox; + this._optionType = 2; + this._messageType = 3; + } + + public JCalendarDialog(Component parentComponent, String title, String message, TKLCalendarComboBox calendarBox, int optionType, int messageType) { + this._parentComponent = parentComponent; + this._title = title; + this._message = message; + this._calendarBox = calendarBox; + this._optionType = optionType; + this._messageType = messageType; + } + + public JCalendarDialog(Component parentComponent, String title, String message, int optionType, int messageType) { + this._parentComponent = parentComponent; + this._title = title; + this._message = message; + this._optionType = optionType; + this._messageType = messageType; + this._calendarBox = new TKLCalendarComboBox(); + } + + public Calendar getCalendar() { + return this.getCalendar(0); + } + + public Calendar getCalendar(int messageOption) { + return this.showConfirmDialog() == messageOption?this._calendarBox.getCalendar():null; + } + + private int showConfirmDialog() { + new JTextField(); + JPanel calPanel = new JPanel(); + FlowLayout layout = new FlowLayout(); + layout.setAlignment(0); + layout.setHgap(0); + layout.setVgap(0); + calPanel.setLayout(layout); + calPanel.add(this._calendarBox); + Object[] msg = new Object[]{this._message, calPanel}; + int result = JOptionPane.showConfirmDialog(this._parentComponent, msg, this._title, this._optionType, this._messageType); + return result; + } +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarPanel.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarPanel.java new file mode 100755 index 00000000..549a3ca2 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JCalendarPanel.java @@ -0,0 +1,315 @@ +/* + * Decompiled with CFR 0.150. + */ +package de.tklsoft.gui.controls.calendar; + +import de.tklsoft.gui.controls.calendar.FlatButton; +import de.tklsoft.gui.controls.calendar.JMonthPanel; +import java.awt.Component; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Locale; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +public class JCalendarPanel + extends JPanel + implements ItemListener, + ChangeListener { + public static final int FIRE_EVERYTIME = 1; + public static final int FIRE_DAYCHANGES = 2; + private int _listenermode = 1; + private boolean _updating = false; + private Calendar _cal; + private DateFormat _format; + private Locale _locale; + private JComboBox _month; + private JComboBox _year; + private JMonthPanel _monthPanel; + private ArrayList<ChangeListener> _changeListener = new ArrayList(); + private boolean _fireingChangeEvent = false; + + public JCalendarPanel() { + this.createGUI(Calendar.getInstance(), Locale.getDefault(), DateFormat.getDateInstance(2, Locale.getDefault()), true); + } + + public JCalendarPanel(Calendar cal) { + this.createGUI(cal, Locale.getDefault(), DateFormat.getDateInstance(2, Locale.getDefault()), true); + } + + public JCalendarPanel(Locale locale) { + this.createGUI(Calendar.getInstance(locale), locale, DateFormat.getDateInstance(2, locale), true); + } + + public JCalendarPanel(Calendar cal, Locale locale) { + this.createGUI(cal, locale, DateFormat.getDateInstance(2, locale), true); + } + + public JCalendarPanel(Calendar cal, Locale locale, DateFormat dateFormat) { + this.createGUI(cal, locale, dateFormat, true); + } + + public JCalendarPanel(Calendar cal, Locale locale, DateFormat dateFormat, boolean flat) { + this.createGUI(cal, locale, dateFormat, flat); + } + + private void createGUI(Calendar cal, Locale locale, DateFormat dateFormat, boolean flat) { + this._locale = locale; + this._cal = Calendar.getInstance(locale); + this._cal.set(5, cal.get(5)); + this._cal.set(2, cal.get(2)); + this._cal.set(1, cal.get(1)); + this._format = dateFormat; + this.setLayout(new GridBagLayout()); + GridBagConstraints c = new GridBagConstraints(); + this._month = this.createMonth(); + this._month.addItemListener(this); + this.add((Component)this._month, c); + this._year = this.createYear(); + this._year.addItemListener(this); + c.gridwidth = 0; + this.add((Component)this._year, c); + c.anchor = 10; + c.fill = 1; + c.insets = new Insets(1, 1, 1, 1); + this._monthPanel = new JMonthPanel(this._cal, this._locale); + this._monthPanel.addChangeListener(this); + this.add((Component)this._monthPanel, c); + c.insets = new Insets(0, 0, 1, 0); + this.add((Component)this.createButtonPanel(flat), c); + this._monthPanel.grabFocus(); + } + + private JPanel createButtonPanel(boolean flat) { + JButton yearRight; + JButton dayRight; + JButton today; + JButton dayLeft; + JButton yearLeft; + JPanel buttonpanel = new JPanel(); + if (flat) { + yearLeft = new FlatButton("<<"); + dayLeft = new FlatButton("<"); + today = new FlatButton("Heute"); + dayRight = new FlatButton(">"); + yearRight = new FlatButton(">>"); + } else { + yearLeft = new JButton("<<"); + yearLeft.setMargin(new Insets(1, 1, 1, 1)); + dayLeft = new JButton("<"); + dayLeft.setMargin(new Insets(1, 1, 1, 1)); + today = new JButton("Heute"); + today.setMargin(new Insets(2, 2, 2, 2)); + dayRight = new JButton(">"); + dayRight.setMargin(new Insets(1, 1, 1, 1)); + yearRight = new JButton(">>"); + yearRight.setMargin(new Insets(1, 1, 1, 1)); + } + buttonpanel.setLayout(new GridBagLayout()); + GridBagConstraints c = new GridBagConstraints(); + c.fill = 0; + c.insets = new Insets(0, 0, 0, 5); + yearLeft.setMargin(new Insets(1, 1, 1, 1)); + yearLeft.setToolTipText("Letztes Jahr"); + yearLeft.addActionListener(new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + if (JCalendarPanel.this._year.getSelectedIndex() > 0) { + int month = JCalendarPanel.this._cal.get(2); + JCalendarPanel.this._cal.set(1, JCalendarPanel.this._cal.get(1) - 1); + if (JCalendarPanel.this._cal.get(2) != month) { + JCalendarPanel.this._cal.set(2, month); + } + JCalendarPanel.this.setCalendar(JCalendarPanel.this._cal); + } + } + }); + buttonpanel.add((Component)yearLeft, c); + dayLeft.addActionListener(new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + int monthIndex = JCalendarPanel.this._cal.get(2); + JCalendarPanel.this._cal.set(2, monthIndex - 1); + if (JCalendarPanel.this._cal.get(2) == monthIndex) { + JCalendarPanel.this._cal.set(5, 0); + } + JCalendarPanel.this.setCalendar(JCalendarPanel.this._cal); + } + }); + dayLeft.setMargin(new Insets(1, 1, 1, 1)); + dayLeft.setToolTipText("N\u00e4chstes Jahr"); + buttonpanel.add((Component)dayLeft, c); + GridBagConstraints c2 = new GridBagConstraints(); + c2.fill = 2; + c2.weightx = 1.0; + today.setMargin(new Insets(2, 2, 2, 2)); + today.addActionListener(new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + JCalendarPanel.this.setCalendar(Calendar.getInstance()); + } + }); + buttonpanel.add((Component)today, c2); + c.insets = new Insets(0, 5, 0, 0); + dayRight.setMargin(new Insets(1, 1, 1, 1)); + dayRight.setToolTipText("N\u00e4chster Monate"); + dayRight.addActionListener(new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + int monthIndex = JCalendarPanel.this._cal.get(2); + JCalendarPanel.this._cal.set(2, monthIndex + 1); + if (JCalendarPanel.this._cal.get(2) != (monthIndex + 1) % 12) { + JCalendarPanel.this._cal.set(5, 0); + } + JCalendarPanel.this.setCalendar(JCalendarPanel.this._cal); + } + }); + buttonpanel.add((Component)dayRight, c); + yearRight.setMargin(new Insets(1, 1, 1, 1)); + yearRight.setToolTipText("N\u00e4chstes Jahr"); + yearRight.addActionListener(new ActionListener(){ + + public void actionPerformed(ActionEvent e) { + if (JCalendarPanel.this._year.getSelectedIndex() < JCalendarPanel.this._year.getItemCount() - 1) { + int month = JCalendarPanel.this._cal.get(2); + JCalendarPanel.this._cal.set(1, JCalendarPanel.this._cal.get(1) + 1); + if (JCalendarPanel.this._cal.get(2) != month) { + JCalendarPanel.this._cal.set(2, month); + } + JCalendarPanel.this.setCalendar(JCalendarPanel.this._cal); + } + } + }); + buttonpanel.add((Component)yearRight, c); + return buttonpanel; + } + + private JComboBox createYear() { + JComboBox<String> year = new JComboBox<String>(); + for (int i = 1900; i <= 2100; ++i) { + year.addItem("" + i); + } + year.setSelectedIndex(this._cal.get(1) - 1900); + return year; + } + + private JComboBox createMonth() { + JComboBox<String> month = new JComboBox<String>(); + SimpleDateFormat format = new SimpleDateFormat("MMMMM", this._locale); + Calendar currentCal = Calendar.getInstance(this._locale); + currentCal.set(5, 1); + for (int i = 0; i < 12; ++i) { + currentCal.set(2, i); + currentCal.set(1, this._cal.get(1)); + String myString = format.format(currentCal.getTime()); + month.addItem(myString); + } + month.setSelectedIndex(this._cal.get(2)); + return month; + } + + private void updateCalendar() { + if (!this._updating) { + this._updating = true; + this._cal.set(2, this._month.getSelectedIndex()); + this._cal.set(1, this._year.getSelectedIndex() + 1900); + this._cal.set(5, this._monthPanel.getSelectedDayOfMonth()); + this._monthPanel.setCalendar(this._cal); + this._monthPanel.grabFocus(); + this._updating = false; + } + } + + public Calendar getCalendar() { + this.updateCalendar(); + return this._cal; + } + + public void setCalendar(Calendar cal) { + this._updating = true; + this._cal.set(5, cal.get(5)); + this._cal.set(2, cal.get(2)); + this._cal.set(1, cal.get(1)); + this._monthPanel.setCalendar(this._cal); + this._year.setSelectedIndex(this._cal.get(1) - 1900); + this._month.setSelectedIndex(this._cal.get(2)); + this._monthPanel.grabFocus(); + this._updating = false; + } + + public String toString() { + this.updateCalendar(); + return this._format.format(this._cal.getTime()); + } + + public String toString(DateFormat format) { + this.updateCalendar(); + return format.format(this._cal.getTime()); + } + + public void itemStateChanged(ItemEvent e) { + this.updateCalendar(); + if (this._listenermode == 1) { + this.fireChangeEvent(); + } + } + + public void stateChanged(ChangeEvent e) { + this.updateCalendar(); + this.fireChangeEvent(); + } + + public void addChangeListener(ChangeListener listener) { + this._changeListener.add(listener); + } + + public void removeChangeListener(ChangeListener listener) { + this._changeListener.remove(listener); + } + + public ChangeListener[] getChangeListener() { + return (ChangeListener[])this._changeListener.toArray(); + } + + protected void fireChangeEvent() { + if (!this._fireingChangeEvent) { + this._fireingChangeEvent = true; + ChangeEvent event = new ChangeEvent(this); + for (ChangeListener cl : this._changeListener) { + cl.stateChanged(event); + } + this._fireingChangeEvent = false; + } + } + + public void setListenerModus(int mode) { + this._listenermode = mode; + } + + public void setEnabled(boolean enabled) { + this._month.setEnabled(enabled); + this._year.setEnabled(enabled); + this._monthPanel.setEnabled(enabled); + } + + public boolean isEnabled() { + return this._month.isEnabled(); + } + + public DateFormat getDateFormat() { + return this._format; + } +} + diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JMonthPanel.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JMonthPanel.java new file mode 100755 index 00000000..65b4c251 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/controls/calendar/JMonthPanel.java @@ -0,0 +1,227 @@ +package de.tklsoft.gui.controls.calendar; + +import de.tklsoft.gui.controls.calendar.DayLabel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.GridLayout; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Iterator; +import java.util.Locale; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +public class JMonthPanel extends JPanel { + + private boolean _enabled = true; + private Calendar _cal; + private Locale _locale; + private ArrayList _days; + private ArrayList _changeListener = new ArrayList(); + private boolean _fireingChangeEvent = false; + public static final Color BACKGROUND_COLOR = UIManager.getColor("TextField.background"); + public static final Color FONT_COLOR = UIManager.getColor("TextField.foreground"); + public static final Color SELECTED_BACKGROUND_COLOR = UIManager.getColor("TextField.selectionBackground"); + public static final Color SELECTED_FONT_COLOR = UIManager.getColor("TextField.selectionForeground"); + public static final Color HEADER_BACKGROUND_COLOR = UIManager.getColor("TextField.inactiveForeground"); + public static final Color HEADER_FONT_COLOR = UIManager.getColor("TextField.inactiveBackground"); + + + public JMonthPanel() { + this.init(Calendar.getInstance(), Locale.getDefault()); + } + + public JMonthPanel(Calendar cal) { + this.init(cal, Locale.getDefault()); + } + + public JMonthPanel(Locale locale) { + this.init(Calendar.getInstance(locale), locale); + } + + public JMonthPanel(Calendar cal, Locale locale) { + this.init(cal, locale); + } + + private void init(Calendar cal, Locale loc) { + this._cal = Calendar.getInstance(loc); + this._cal.set(5, cal.get(5)); + this._cal.set(2, cal.get(2)); + this._cal.set(1, cal.get(1)); + this._locale = loc; + this.createGUI(); + } + + private void createGUI() { + this.setLayout(new BorderLayout()); + this.add(this.createHeader(), "North"); + this.add(this.createTable(), "Center"); + } + + private JPanel createHeader() { + JPanel header = new JPanel(); + header.setLayout(new GridLayout(1, 7, 1, 1)); + header.setBackground(HEADER_BACKGROUND_COLOR); + SimpleDateFormat format = new SimpleDateFormat("E", this._locale); + Calendar cal = (Calendar)this._cal.clone(); + char[] letters = new char[7]; + + int pos; + for(pos = 0; pos < 7; ++pos) { + letters[cal.get(7) - 1] = format.format(cal.getTime()).charAt(0); + cal.set(5, cal.get(5) + 1); + } + + pos = cal.getFirstDayOfWeek() - 1; + + for(int i = 0; i < 7; ++i) { + JLabel empty = new JLabel(String.valueOf(letters[pos])); + ++pos; + if(pos > 6) { + pos = 0; + } + + empty.setHorizontalAlignment(4); + empty.setForeground(HEADER_FONT_COLOR); + header.add(empty); + } + + return header; + } + + private JPanel createTable() { + this._days = new ArrayList(); + JPanel table = new JPanel(); + table.setBackground(BACKGROUND_COLOR); + table.setLayout(new GridLayout(6, 7, 1, 1)); + int position = 0; + Calendar today = Calendar.getInstance(); + Calendar cal = (Calendar)this._cal.clone(); + cal.set(5, 1); + int month = cal.get(2); + int firstDay = cal.get(7); + if(firstDay == 0) { + --firstDay; + } else { + firstDay -= cal.getFirstDayOfWeek(); + } + + if(firstDay < 0) { + firstDay += 7; + } + + while(position < firstDay) { + JLabel curDay = new JLabel(); + table.add(curDay); + ++position; + } + + int var10 = this._cal.get(5); + + while(position < 42 && cal.get(2) == month) { + boolean empty = false; + if(cal.get(1) == today.get(1) && cal.get(2) == today.get(2) && cal.get(5) == today.get(5)) { + empty = true; + } + + DayLabel day = new DayLabel(cal.get(5), empty, this); + table.add(day); + this._days.add(day); + if(var10 == cal.get(5)) { + day.setSelected(true); + } + + ++position; + cal.set(5, cal.get(5) + 1); + } + + while(position < 42) { + JLabel var11 = new JLabel(); + table.add(var11); + ++position; + } + + return table; + } + + public void setCalendar(Calendar cal) { + this._cal.set(5, cal.get(5)); + this._cal.set(2, cal.get(2)); + this._cal.set(1, cal.get(1)); + this.removeAll(); + this.createGUI(); + this.updateUI(); + DayLabel dayLabel = (DayLabel)this._days.get(cal.get(5) - 1); + dayLabel.grabFocus(); + this.setBackground(BACKGROUND_COLOR); + } + + public void grabFocus() { + super.grabFocus(); + DayLabel dayLabel = (DayLabel)this._days.get(this._cal.get(5) - 1); + dayLabel.grabFocus(); + } + + public Calendar getCalendar() { + return this._cal; + } + + public void setSelectedDayOfMonth(int day) { + if(this._enabled && day > 0 && day <= this._days.size()) { + int oldday = this._cal.get(5); + DayLabel dayLabel = (DayLabel)this._days.get(oldday - 1); + dayLabel.setSelected(false); + this._cal.set(5, day); + dayLabel = (DayLabel)this._days.get(day - 1); + dayLabel.setSelected(true); + this.updateUI(); + this.fireChangeEvent(); + } + + } + + public int getSelectedDayOfMonth() { + return this._cal.get(5); + } + + public void addChangeListener(ChangeListener listener) { + this._changeListener.add(listener); + } + + public void removeChangeListener(ChangeListener listener) { + this._changeListener.remove(listener); + } + + public ChangeListener[] getChangeListener() { + return (ChangeListener[])((ChangeListener[])this._changeListener.toArray()); + } + + protected void fireChangeEvent() { + if(!this._fireingChangeEvent) { + this._fireingChangeEvent = true; + ChangeEvent event = new ChangeEvent(this); + Iterator i$ = this._changeListener.iterator(); + + while(i$.hasNext()) { + ChangeListener cl = (ChangeListener)i$.next(); + cl.stateChanged(event); + } + + this._fireingChangeEvent = false; + } + + } + + public void setEnabled(boolean enabled) { + this._enabled = enabled; + } + + public boolean isEnabled() { + return this._enabled; + } + +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizable.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizable.java new file mode 100755 index 00000000..25a1b730 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizable.java @@ -0,0 +1,10 @@ +package de.tklsoft.gui.layout; + +import java.awt.Dimension; + +public interface Synchronizable { + + void setSynchronizer(Synchronizer var1); + + Dimension getNormalSize(); +} diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizer.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizer.java new file mode 100755 index 00000000..72b3ac5f --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/gui/layout/Synchronizer.java @@ -0,0 +1,80 @@ +/* + * Decompiled with CFR 0.150. + */ +package de.tklsoft.gui.layout; + +import de.tklsoft.gui.layout.Synchronizable; +import java.awt.Dimension; +import java.util.HashSet; + +public class Synchronizer { + private HashSet<Synchronizable> items = new HashSet(); + private final METHOD method; + + public Synchronizer(METHOD method) { + this.method = method; + } + + public void add(Synchronizable synchronizable) { + this.items.add(synchronizable); + synchronizable.setSynchronizer(this); + } + + public Dimension getSize(Synchronizable synchronizable) { + if (this.method == METHOD.WIDTH) { + return this.getSizeByWidth(synchronizable); + } + if (this.method == METHOD.HEIGHT) { + return this.getSizeByHeight(synchronizable); + } + if (this.method == METHOD.WIGHT_AND_HEIGHT) { + return this.getSizeByWidthAndHeight(); + } + return null; + } + + private Dimension getSizeByWidthAndHeight() { + int height = 0; + int width = 0; + for (Synchronizable curSynchronizable : this.items) { + Dimension dim = curSynchronizable.getNormalSize(); + if (dim.height > height) { + height = dim.height; + } + if (dim.width <= width) continue; + width = dim.width; + } + return new Dimension(width, height); + } + + private Dimension getSizeByHeight(Synchronizable synchronizable) { + int height = 0; + for (Synchronizable curSynchronizable : this.items) { + Dimension dim = curSynchronizable.getNormalSize(); + if (dim.height <= height) continue; + height = dim.height; + } + return new Dimension(synchronizable.getNormalSize().width, height); + } + + private Dimension getSizeByWidth(Synchronizable synchronizable) { + int width = 0; + for (Synchronizable curSynchronizable : this.items) { + Dimension dim = curSynchronizable.getNormalSize(); + if (dim.width <= width) continue; + width = dim.width; + } + return new Dimension(width, synchronizable.getNormalSize().height); + } + + /* + * This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6. + */ + public static enum METHOD { + WIDTH, + HEIGHT, + WIGHT_AND_HEIGHT; + + } +} + diff --git a/modules/AJCoreGUI/src/main/java/de/tklsoft/icon/IconManager.java b/modules/AJCoreGUI/src/main/java/de/tklsoft/icon/IconManager.java new file mode 100755 index 00000000..b941ad33 --- /dev/null +++ b/modules/AJCoreGUI/src/main/java/de/tklsoft/icon/IconManager.java @@ -0,0 +1,44 @@ +package de.tklsoft.icon; + +import java.awt.Image; +import java.io.File; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import javax.swing.ImageIcon; + +public class IconManager { + + private static IconManager instance = null; + private Map icons = new HashMap(); + + + public static IconManager getInstance() { + if(instance == null) { + instance = new IconManager(); + } + + return instance; + } + + public ImageIcon getIcon(String key) { + ImageIcon result = null; + + try { + if(this.icons.containsKey(key)) { + result = (ImageIcon)this.icons.get(key); + } else { + String url = System.getProperty("user.dir") + File.separator + "icons" + File.separator + key + ".gif"; + Image img = (new ImageIcon(url)).getImage(); + result = new ImageIcon(img); + this.icons.put(key, result); + } + + return result; + } catch (Exception var6) { + var6.printStackTrace(); + return null; + } + } + +} diff --git a/modules/logviewer/logviewer.iml b/modules/logviewer/logviewer.iml new file mode 100644 index 00000000..a3295787 --- /dev/null +++ b/modules/logviewer/logviewer.iml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="AJCoreGUI" /> + <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.1" level="project" /> + <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> + <orderEntry type="library" name="Maven: skinlf:skinlf:1.2.3" level="project" /> + <orderEntry type="library" name="Maven: tablelayout:TableLayout:20050920" level="project" /> + <orderEntry type="library" name="Maven: com.jgoodies:looks:2.2.1" level="project" /> + <orderEntry type="library" name="Maven: xerces:xercesImpl:2.6.2" level="project" /> + <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/modules/logviewer/pom.xml b/modules/logviewer/pom.xml new file mode 100644 index 00000000..03059dad --- /dev/null +++ b/modules/logviewer/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client.gui.plugins</groupId> + <artifactId>logviewer</artifactId> + <version>1.3.1</version> + <packaging>jar</packaging> + + <parent> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <relativePath>./../../pom.xml</relativePath> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>de.applejuicenet.client.gui</groupId> + <artifactId>AJCoreGUI</artifactId> + <version>0.83.3</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.2.0</version> + </plugin> + </plugins> + </build> +</project> diff --git a/AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/FileModificationDateComparator.java b/modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/FileModificationDateComparator.java similarity index 100% rename from AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/FileModificationDateComparator.java rename to modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/FileModificationDateComparator.java diff --git a/AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/FileNameListCellRenderer.java b/modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/FileNameListCellRenderer.java similarity index 100% rename from AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/FileNameListCellRenderer.java rename to modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/FileNameListCellRenderer.java diff --git a/AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/LogViewerPlugin.java b/modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/LogViewerPlugin.java similarity index 100% rename from AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/LogViewerPlugin.java rename to modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/LogViewerPlugin.java diff --git a/AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/LogViewerTestLoader.java b/modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/LogViewerTestLoader.java similarity index 100% rename from AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/LogViewerTestLoader.java rename to modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/LogViewerTestLoader.java diff --git a/AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/SortedStringListModel.java b/modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/SortedStringListModel.java similarity index 100% rename from AJClientGUI/plugin_src/logviewer/src/de/applejuicenet/client/gui/plugins/logviewer/SortedStringListModel.java rename to modules/logviewer/src/main/java/de/applejuicenet/client/gui/plugins/logviewer/SortedStringListModel.java diff --git a/AJClientGUI/plugin_src/logviewer/icons/icon.gif b/modules/logviewer/src/main/resources/icon.gif similarity index 100% rename from AJClientGUI/plugin_src/logviewer/icons/icon.gif rename to modules/logviewer/src/main/resources/icon.gif diff --git a/AJClientGUI/plugin_src/logviewer/plugin.properties b/modules/logviewer/src/main/resources/plugin.properties similarity index 66% rename from AJClientGUI/plugin_src/logviewer/plugin.properties rename to modules/logviewer/src/main/resources/plugin.properties index 4aa631f1..c6f734ed 100644 --- a/AJClientGUI/plugin_src/logviewer/plugin.properties +++ b/modules/logviewer/src/main/resources/plugin.properties @@ -1,7 +1,7 @@ general.title=LogViewer -general.version=1.3 +general.version=1.3.1 general.author=loevenwong general.contact=tloevenich@tkl-soft.de -general.description=Mit dem Logviewer knnen die Logs angezeigt werden. +general.description=Mit dem Logviewer können die Logs angezeigt werden. general.istab=true general.classname=de.applejuicenet.client.gui.plugins.logviewer.LogViewerPlugin diff --git a/modules/serverwatcher/pom.xml b/modules/serverwatcher/pom.xml new file mode 100644 index 00000000..8bbc1c1d --- /dev/null +++ b/modules/serverwatcher/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client.gui.plugins</groupId> + <artifactId>serverwatcher</artifactId> + <version>1.5.0</version> + <packaging>jar</packaging> + + <parent> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <relativePath>./../../pom.xml</relativePath> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>de.applejuicenet.client.gui</groupId> + <artifactId>AJCoreGUI</artifactId> + <version>0.83.0</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.2.0</version> + </plugin> + </plugins> + </build> +</project> diff --git a/modules/serverwatcher/serverwatcher.iml b/modules/serverwatcher/serverwatcher.iml new file mode 100644 index 00000000..61fdfcde --- /dev/null +++ b/modules/serverwatcher/serverwatcher.iml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: de.applejuicenet.client.gui:AJCoreGUI:0.83.0" level="project" /> + <orderEntry type="library" name="Maven: de.applejuicenet.client:tklcontrols:1.0" level="project" /> + <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.1" level="project" /> + <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> + <orderEntry type="library" name="Maven: skinlf:skinlf:1.2.3" level="project" /> + <orderEntry type="library" name="Maven: tablelayout:TableLayout:20050920" level="project" /> + <orderEntry type="library" name="Maven: com.jgoodies:looks:2.2.1" level="project" /> + <orderEntry type="library" name="Maven: xerces:xercesImpl:2.6.2" level="project" /> + <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/NewServerDialog.java b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/NewServerDialog.java similarity index 100% rename from AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/NewServerDialog.java rename to modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/NewServerDialog.java diff --git a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java similarity index 93% rename from AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java rename to modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java index 82b35fe3..6e687e3c 100644 --- a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java +++ b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java @@ -5,6 +5,8 @@ package de.applejuicenet.client.gui.plugins.serverwatcher; +import java.util.Base64; + /** * $Header: /home/xubuntu/berlios_backup/github/tmp-cvs/applejuicejava/Repository/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerConfig.java,v 1.3 2009/01/12 10:19:56 maj0r Exp $ * @@ -46,7 +48,7 @@ public ServerConfig(String dyn, String port, String userpass) } this.port = port; - this.userpass = new sun.misc.BASE64Encoder().encode(userpass.getBytes()); + this.userpass = Base64.getEncoder().withoutPadding().encodeToString(userpass.getBytes()); } public String getBezeichnung() diff --git a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherPlugin.java b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherPlugin.java similarity index 100% rename from AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherPlugin.java rename to modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherPlugin.java diff --git a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherTestLoader.java b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherTestLoader.java similarity index 100% rename from AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherTestLoader.java rename to modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerWatcherTestLoader.java diff --git a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java similarity index 93% rename from AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java rename to modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java index 5fb69a9e..1141239a 100644 --- a/AJClientGUI/plugin_src/serverwatcher/src/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java +++ b/modules/serverwatcher/src/main/java/de/applejuicenet/client/gui/plugins/serverwatcher/ServerXML.java @@ -119,15 +119,7 @@ public static String getXMLPath() { String path; - if(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) - { - path = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui" + File.separator + - "plugins" + File.separator + "serverwatcher.xml"; - } - else - { - path = System.getProperty("user.dir") + File.separator + "plugins" + File.separator + "serverwatcher.xml"; - } + path = System.getProperty("user.home") + File.separator + "appleJuice" + File.separator + "gui" + File.separator + "plugins" + File.separator + "serverwatcher.xml"; return path; } diff --git a/AJClientGUI/plugin_src/ircplugin/icons/icon.gif b/modules/serverwatcher/src/main/resources/icon.gif similarity index 100% rename from AJClientGUI/plugin_src/ircplugin/icons/icon.gif rename to modules/serverwatcher/src/main/resources/icon.gif diff --git a/AJClientGUI/plugin_src/serverwatcher/plugin.properties b/modules/serverwatcher/src/main/resources/plugin.properties similarity index 70% rename from AJClientGUI/plugin_src/serverwatcher/plugin.properties rename to modules/serverwatcher/src/main/resources/plugin.properties index 74bce7bc..14c1d25a 100644 --- a/AJClientGUI/plugin_src/serverwatcher/plugin.properties +++ b/modules/serverwatcher/src/main/resources/plugin.properties @@ -1,7 +1,7 @@ general.title=ServerWatcher -general.version=1.5 +general.version=1.5.0 general.author=Maj0r general.contact=tkrall@tkl-soft.de -general.description=Mit dem Serverwatcher kann der Status von Servern angezeigt werden. Bentigt wird ein GUI ab 0.70.4 +general.description=Mit dem Serverwatcher kann der Status von Servern angezeigt werden. general.istab=true -general.classname=de.applejuicenet.client.gui.plugins.serverwatcher.ServerWatcherPlugin \ No newline at end of file +general.classname=de.applejuicenet.client.gui.plugins.serverwatcher.ServerWatcherPlugin diff --git a/modules/standardpwdlpolicy/pom.xml b/modules/standardpwdlpolicy/pom.xml new file mode 100644 index 00000000..ed27527f --- /dev/null +++ b/modules/standardpwdlpolicy/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client</groupId> + <artifactId>StandardPwdlPolicy</artifactId> + <version>1.3.1</version> + <packaging>jar</packaging> + + <parent> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <relativePath>./../../pom.xml</relativePath> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>de.applejuicenet.client.gui</groupId> + <artifactId>AJCoreGUI</artifactId> + <version>0.83.3</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.2.0</version> + </plugin> + </plugins> + </build> +</project> diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/EinstellungenDialog.java b/modules/standardpwdlpolicy/src/main/java/de/applejuicenet/client/gui/powerdownload/EinstellungenDialog.java similarity index 100% rename from AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/EinstellungenDialog.java rename to modules/standardpwdlpolicy/src/main/java/de/applejuicenet/client/gui/powerdownload/EinstellungenDialog.java diff --git a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java b/modules/standardpwdlpolicy/src/main/java/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java similarity index 96% rename from AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java rename to modules/standardpwdlpolicy/src/main/java/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java index e6b97cb2..6e5f48f5 100644 --- a/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java +++ b/modules/standardpwdlpolicy/src/main/java/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java @@ -18,7 +18,7 @@ * $Header: * /cvsroot/applejuicejava/AJClientGUI/pwdl_policy_src/standardpwdlpolicy/src/de/applejuicenet/client/gui/powerdownload/StandardAutomaticPwdlPolicy.java,v * 1.17 2005/02/17 22:22:21 loevenwong Exp $ - * + * * <p> * Titel: AppleJuice Client-GUI * </p> @@ -29,9 +29,9 @@ * <p> * Copyright: General Public License * </p> - * + * * @author: Maj0r [aj@tkl-soft.de] - * + * */ public class StandardAutomaticPwdlPolicy extends AutomaticPowerdownloadPolicy { @@ -169,7 +169,7 @@ public void informPaused() { } public String getVersion() { - return "1.3"; + return "1.3.1"; } public String getDescription() { @@ -223,11 +223,11 @@ public Sortierkriterium(Double prozentGeladen, Long groesse, } public Sortierkriterium(Download current) { - this.prozentGeladen = new Double(current.getProzentGeladen()); - this.groesse = new Long(current.getGroesse()); - this.id = new Integer(current.getId()); + this.prozentGeladen = current.getProzentGeladen(); + this.groesse = (long) current.getGroesse(); + this.id = current.getId(); if (current.getSources() != null) { - this.quellenAnzahl = new Integer(current.getSources().length); + this.quellenAnzahl = current.getSources().length; } } diff --git a/modules/versionchecker/pom.xml b/modules/versionchecker/pom.xml new file mode 100644 index 00000000..009687ae --- /dev/null +++ b/modules/versionchecker/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client.gui.plugins</groupId> + <artifactId>versionchecker</artifactId> + <version>1.6.1</version> + <packaging>jar</packaging> + + <parent> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <relativePath>./../../pom.xml</relativePath> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>de.applejuicenet.client.gui</groupId> + <artifactId>AJCoreGUI</artifactId> + <version>0.83.3</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.2.0</version> + </plugin> + </plugins> + </build> +</project> diff --git a/AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/VersionChecker.java b/modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/VersionChecker.java similarity index 100% rename from AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/VersionChecker.java rename to modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/VersionChecker.java diff --git a/AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/VersioncheckerTestLoader.java b/modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/VersioncheckerTestLoader.java similarity index 100% rename from AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/VersioncheckerTestLoader.java rename to modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/VersioncheckerTestLoader.java diff --git a/AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/MainPanel.java b/modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/MainPanel.java similarity index 100% rename from AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/MainPanel.java rename to modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/MainPanel.java diff --git a/AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionHolder.java b/modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionHolder.java similarity index 100% rename from AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionHolder.java rename to modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionHolder.java diff --git a/AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionTableModel.java b/modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionTableModel.java similarity index 100% rename from AJClientGUI/plugin_src/versionchecker/src/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionTableModel.java rename to modules/versionchecker/src/main/java/de/applejuicenet/client/gui/plugins/versionchecker/panels/VersionTableModel.java diff --git a/AJClientGUI/plugin_src/serverwatcher/icons/icon.gif b/modules/versionchecker/src/main/resources/icon.gif similarity index 100% rename from AJClientGUI/plugin_src/serverwatcher/icons/icon.gif rename to modules/versionchecker/src/main/resources/icon.gif diff --git a/AJClientGUI/plugin_src/versionchecker/language_deutsch.properties b/modules/versionchecker/src/main/resources/language_deutsch.properties similarity index 67% rename from AJClientGUI/plugin_src/versionchecker/language_deutsch.properties rename to modules/versionchecker/src/main/resources/language_deutsch.properties index ff23b467..f4d2e7bd 100644 --- a/AJClientGUI/plugin_src/versionchecker/language_deutsch.properties +++ b/modules/versionchecker/src/main/resources/language_deutsch.properties @@ -1,3 +1,3 @@ language=deutsch -language.description=Welche Core-Versionen sind zurzeit im Einsatz? Welche Betriebssysteme werden eingesetzt? Dieses Plugin beantwortet Deine Fragen. GUI ab 0.70.4 wird benigt. -language.istab=true \ No newline at end of file +language.description=Welche Core-Versionen sind zurzeit im Einsatz? Welche Betriebssysteme werden eingesetzt? Dieses Plugin beantwortet Deine Fragen. +language.istab=true diff --git a/AJClientGUI/plugin_src/versionchecker/language_english.properties b/modules/versionchecker/src/main/resources/language_english.properties similarity index 81% rename from AJClientGUI/plugin_src/versionchecker/language_english.properties rename to modules/versionchecker/src/main/resources/language_english.properties index 7dced079..a3d615d4 100644 --- a/AJClientGUI/plugin_src/versionchecker/language_english.properties +++ b/modules/versionchecker/src/main/resources/language_english.properties @@ -1,2 +1,2 @@ language=english -language.description=Which core-version are currently used? Which operating-systems are used? This plugins answers your questions. GUI 0.70.4 or higher is needed. \ No newline at end of file +language.description=Which core-version are currently used? Which operating-systems are used? This plugins answers your questions. diff --git a/AJClientGUI/plugin_src/versionchecker/plugin.properties b/modules/versionchecker/src/main/resources/plugin.properties similarity index 76% rename from AJClientGUI/plugin_src/versionchecker/plugin.properties rename to modules/versionchecker/src/main/resources/plugin.properties index ae35dd7e..081eaf81 100644 --- a/AJClientGUI/plugin_src/versionchecker/plugin.properties +++ b/modules/versionchecker/src/main/resources/plugin.properties @@ -1,7 +1,7 @@ general.title=VersionChecker -general.version=1.6 +general.version=1.6.1 general.author=Maj0r general.contact=tkrall@tkl-soft.de -general.description=Welche Core-Versionen sind zurzeit im Einsatz? Welche Betriebssysteme werden eingesetzt? Dieses Plugin beantwortet Deine Fragen. GUI ab 0.70.4 wird bentigt." +general.description=Welche Core-Versionen sind zurzeit im Einsatz? Welche Betriebssysteme werden eingesetzt? Dieses Plugin beantwortet Deine Fragen. general.istab=true -general.classname=de.applejuicenet.client.gui.plugins.versionchecker.VersionChecker \ No newline at end of file +general.classname=de.applejuicenet.client.gui.plugins.versionchecker.VersionChecker diff --git a/osx/AJCoreGUI.icns b/osx/AJCoreGUI.icns new file mode 100644 index 00000000..4f8389e9 Binary files /dev/null and b/osx/AJCoreGUI.icns differ diff --git a/osx/Info.plist b/osx/Info.plist new file mode 100644 index 00000000..97f0b1c0 --- /dev/null +++ b/osx/Info.plist @@ -0,0 +1,56 @@ +<?xml version="1.0" ?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleDevelopmentRegion</key> + <string>German</string> + + <key>CFBundleExecutable</key> + <string>universalJavaApplicationStub</string> + + <key>CFBundleIconFile</key> + <string>AJCoreGUI.icns</string> + + <key>CFBundleIdentifier</key> + <string>de.applejuicenet.client.AppleJuiceClient</string> + + <key>CFBundleDisplayName</key> + <string>AJCoreGUI</string> + + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + + <key>CFBundleName</key> + <string>AJCoreGUI</string> + + <key>CFBundlePackageType</key> + <string>APPL</string> + + <key>NSHighResolutionCapable</key> + <string>True</string> + + <key>CFBundleShortVersionString</key> + <string>1.0.1</string> + + <key>CFBundleSignature</key> + <string>agui</string> + + <key>CFBundleVersion</key> + <string>1.0.1</string> + + <key>CFBundleURLTypes</key> + <array> + <dict> + <key>CFBundleURLName</key> + <string>appleJuice Links</string> + <key>CFBundleURLSchemes</key> + <array> + <string>ajfsp</string> + </array> + </dict> + </array> + + <key>JVMMainClassName</key> + <string>de.applejuicenet.client.AppleJuiceClient</string> + </dict> +</plist> diff --git a/osx/universalJavaApplicationStub b/osx/universalJavaApplicationStub new file mode 100644 index 00000000..35255566 --- /dev/null +++ b/osx/universalJavaApplicationStub @@ -0,0 +1,797 @@ +#!/bin/bash +################################################################################## +# # +# universalJavaApplicationStub # +# # +# A BASH based JavaApplicationStub for Java Apps on Mac OS X # +# that works with both Apple's and Oracle's plist format. # +# # +# Inspired by Ian Roberts stackoverflow answer # +# at http://stackoverflow.com/a/17546508/1128689 # +# # +# @author Tobias Fischer # +# @url https://github.com/tofi86/universalJavaApplicationStub # +# @date 2020-03-19 # +# @version 3.0.6 # +# # +################################################################################## +# # +# The MIT License (MIT) # +# # +# Copyright (c) 2014-2020 Tobias Fischer # +# # +# Permission is hereby granted, free of charge, to any person obtaining a copy # +# of this software and associated documentation files (the "Software"), to deal # +# in the Software without restriction, including without limitation the rights # +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # +# copies of the Software, and to permit persons to whom the Software is # +# furnished to do so, subject to the following conditions: # +# # +# The above copyright notice and this permission notice shall be included in all # +# copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # +# SOFTWARE. # +# # +################################################################################## + + + +# function 'stub_logger()' +# +# A logger which logs to the macOS Console.app using the 'syslog' command +# +# @param1 the log message +# @return void +################################################################################ +function stub_logger() { + syslog -s -k \ + Facility com.apple.console \ + Level Notice \ + Sender "$(basename "$0")" \ + Message "[$$][${CFBundleName:-$(basename "$0")}] $1" +} + + + +# set the directory abspath of the current +# shell script with symlinks being resolved +############################################ + +PRG=$0 +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null) + if expr "$link" : '^/' 2> /dev/null >/dev/null; then + PRG="$link" + else + PRG="$(dirname "$PRG")/$link" + fi +done +PROGDIR=$(dirname "$PRG") +stub_logger "[StubDir] $PROGDIR" + + + +# set files and folders +############################################ + +# the absolute path of the app package +cd "$PROGDIR"/../../ || exit 11 +AppPackageFolder=$(pwd) + +# the base path of the app package +cd .. || exit 12 +AppPackageRoot=$(pwd) + +# set Apple's Java folder +AppleJavaFolder="${AppPackageFolder}"/Contents/Resources/Java + +# set Apple's Resources folder +AppleResourcesFolder="${AppPackageFolder}"/Contents/Resources + +# set Oracle's Java folder +OracleJavaFolder="${AppPackageFolder}"/Contents/Java + +# set Oracle's Resources folder +OracleResourcesFolder="${AppPackageFolder}"/Contents/Resources + +# set path to Info.plist in bundle +InfoPlistFile="${AppPackageFolder}"/Contents/Info.plist + +# set the default JVM Version to a null string +JVMVersion="" +JVMMaxVersion="" + + + +# function 'plist_get()' +# +# read a specific Plist key with 'PlistBuddy' utility +# +# @param1 the Plist key with leading colon ':' +# @return the value as String or Array +################################################################################ +plist_get(){ + /usr/libexec/PlistBuddy -c "print $1" "${InfoPlistFile}" 2> /dev/null +} + +# function 'plist_get_java()' +# +# read a specific Plist key with 'PlistBuddy' utility +# in the 'Java' or 'JavaX' dictionary (<dict>) +# +# @param1 the Plist :Java(X):Key with leading colon ':' +# @return the value as String or Array +################################################################################ +plist_get_java(){ + plist_get ${JavaKey:-":Java"}$1 +} + + + +# read Info.plist and extract JVM options +############################################ + +# read the program name from CFBundleName +CFBundleName=$(plist_get ':CFBundleName') + +# read the icon file name +CFBundleIconFile=$(plist_get ':CFBundleIconFile') + + +# check Info.plist for Apple style Java keys -> if key :Java is present, parse in apple mode +/usr/libexec/PlistBuddy -c "print :Java" "${InfoPlistFile}" > /dev/null 2>&1 +exitcode=$? +JavaKey=":Java" + +# if no :Java key is present, check Info.plist for universalJavaApplication style JavaX keys -> if key :JavaX is present, parse in apple mode +if [ $exitcode -ne 0 ]; then + /usr/libexec/PlistBuddy -c "print :JavaX" "${InfoPlistFile}" > /dev/null 2>&1 + exitcode=$? + JavaKey=":JavaX" +fi + + +# read 'Info.plist' file in Apple style if exit code returns 0 (true, ':Java' key is present) +if [ $exitcode -eq 0 ]; then + stub_logger "[PlistStyle] Apple" + + # set Java and Resources folder + JavaFolder="${AppleJavaFolder}" + ResourcesFolder="${AppleResourcesFolder}" + + APP_PACKAGE="${AppPackageFolder}" + JAVAROOT="${AppleJavaFolder}" + USER_HOME="$HOME" + + + # read the Java WorkingDirectory + JVMWorkDir=$(plist_get_java ':WorkingDirectory' | xargs) + # set Working Directory based upon PList value + if [[ ! -z ${JVMWorkDir} ]]; then + WorkingDirectory="${JVMWorkDir}" + else + # AppPackageRoot is the standard WorkingDirectory when the script is started + WorkingDirectory="${AppPackageRoot}" + fi + # expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME + WorkingDirectory=$(eval echo "${WorkingDirectory}") + + + # read the MainClass name + JVMMainClass="$(plist_get_java ':MainClass')" + + # read the SplashFile name + JVMSplashFile=$(plist_get_java ':SplashFile') + + # read the JVM Properties as an array and retain spaces + IFS=$'\t\n' + JVMOptions=($(xargs -n1 <<<$(plist_get_java ':Properties' | grep " =" | sed 's/^ */-D/g' | sed -E 's/ = (.*)$/="\1"/g'))) + unset IFS + # post processing of the array follows further below... + + # read the ClassPath in either Array or String style + JVMClassPath_RAW=$(plist_get_java ':ClassPath' | xargs) + if [[ $JVMClassPath_RAW == *Array* ]] ; then + JVMClassPath=.$(plist_get_java ':ClassPath' | grep " " | sed 's/^ */:/g' | tr -d '\n' | xargs) + else + JVMClassPath=${JVMClassPath_RAW} + fi + # expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME + JVMClassPath=$(eval echo "${JVMClassPath}") + + # read the JVM Options in either Array or String style + JVMDefaultOptions_RAW=$(plist_get_java ':VMOptions' | xargs) + if [[ $JVMDefaultOptions_RAW == *Array* ]] ; then + JVMDefaultOptions=$(plist_get_java ':VMOptions' | grep " " | sed 's/^ */ /g' | tr -d '\n' | xargs) + else + JVMDefaultOptions=${JVMDefaultOptions_RAW} + fi + + # read StartOnMainThread and add as -XstartOnFirstThread + JVMStartOnMainThread=$(plist_get_java ':StartOnMainThread') + if [ "${JVMStartOnMainThread}" == "true" ]; then + JVMDefaultOptions+=" -XstartOnFirstThread" + fi + + # read the JVM Arguments in either Array or String style (#76) and retain spaces + IFS=$'\t\n' + MainArgs_RAW=$(plist_get_java ':Arguments' | xargs) + if [[ $MainArgs_RAW == *Array* ]] ; then + MainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments' | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/ */ /g'))) + else + MainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments'))) + fi + unset IFS + # post processing of the array follows further below... + + # read the Java version we want to find + JVMVersion=$(plist_get_java ':JVMVersion' | xargs) + # post processing of the version string follows below... + + +# read 'Info.plist' file in Oracle style +else + stub_logger "[PlistStyle] Oracle" + + # set Working Directory and Java and Resources folder + JavaFolder="${OracleJavaFolder}" + ResourcesFolder="${OracleResourcesFolder}" + WorkingDirectory="${OracleJavaFolder}" + + APP_ROOT="${AppPackageFolder}" + + # read the MainClass name + JVMMainClass="$(plist_get ':JVMMainClassName')" + + # read the SplashFile name + JVMSplashFile=$(plist_get ':JVMSplashFile') + + # read the JVM Options as an array and retain spaces + IFS=$'\t\n' + JVMOptions=($(plist_get ':JVMOptions' | grep " " | sed 's/^ *//g')) + unset IFS + # post processing of the array follows further below... + + # read the ClassPath in either Array or String style + JVMClassPath_RAW=$(plist_get ':JVMClassPath') + if [[ $JVMClassPath_RAW == *Array* ]] ; then + JVMClassPath=.$(plist_get ':JVMClassPath' | grep " " | sed 's/^ */:/g' | tr -d '\n' | xargs) + # expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME + JVMClassPath=$(eval echo "${JVMClassPath}") + + elif [[ ! -z ${JVMClassPath_RAW} ]] ; then + JVMClassPath=${JVMClassPath_RAW} + # expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOME + JVMClassPath=$(eval echo "${JVMClassPath}") + + else + #default: fallback to OracleJavaFolder + JVMClassPath="${JavaFolder}/*" + # Do NOT expand the default 'AppName.app/Contents/Java/*' classpath (#42) + fi + + # read the JVM Default Options + JVMDefaultOptions=$(plist_get ':JVMDefaultOptions' | grep -o " \-.*" | tr -d '\n' | xargs) + + # read the Main Arguments from JVMArguments key as an array and retain spaces (see #46 for naming details) + IFS=$'\t\n' + MainArgs=($(xargs -n1 <<<$(plist_get ':JVMArguments' | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/ */ /g'))) + unset IFS + # post processing of the array follows further below... + + # read the Java version we want to find + JVMVersion=$(plist_get ':JVMVersion' | xargs) + # post processing of the version string follows below... +fi + + +# (#75) check for undefined icons or icon names without .icns extension and prepare +# an osascript statement for those cases when the icon can be shown in the dialog +DialogWithIcon="" +if [ ! -z ${CFBundleIconFile} ]; then + if [[ ${CFBundleIconFile} == *.icns ]] && [[ -f "${ResourcesFolder}/${CFBundleIconFile}" ]] ; then + DialogWithIcon=" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" + elif [[ ${CFBundleIconFile} != *.icns ]] && [[ -f "${ResourcesFolder}/${CFBundleIconFile}.icns" ]] ; then + CFBundleIconFile+=".icns" + DialogWithIcon=" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" + fi +fi + + +# JVMVersion: post processing and optional splitting +if [[ ${JVMVersion} == *";"* ]]; then + minMaxArray=(${JVMVersion//;/ }) + JVMVersion=${minMaxArray[0]//+} + JVMMaxVersion=${minMaxArray[1]//+} +fi +stub_logger "[JavaRequirement] JVM minimum version: ${JVMVersion}" +stub_logger "[JavaRequirement] JVM maximum version: ${JVMMaxVersion}" + +# MainArgs: replace occurences of $APP_ROOT with its content +MainArgsArr=() +for i in "${MainArgs[@]}" +do + MainArgsArr+=("$(eval echo "$i")") +done + +# JVMOptions: replace occurences of $APP_ROOT with its content +JVMOptionsArr=() +for i in "${JVMOptions[@]}" +do + JVMOptionsArr+=("$(eval echo "$i")") +done + + +# internationalized messages +############################################ + +LANG=$(defaults read -g AppleLocale) +stub_logger "[Language] $LANG" + +# French localization +if [[ $LANG == fr* ]] ; then + MSG_ERROR_LAUNCHING="ERREUR au lancement de '${CFBundleName}'." + MSG_MISSING_MAINCLASS="'MainClass' n'est pas spécifié.\nL'application Java ne peut pas être lancée." + MSG_JVMVERSION_REQ_INVALID="La syntaxe de la version de Java demandée est invalide: %s\nVeuillez contacter le développeur de l'application." + MSG_NO_SUITABLE_JAVA="La version de Java installée sur votre système ne convient pas.\nCe programme nécessite Java %s" + MSG_JAVA_VERSION_OR_LATER="ou ultérieur" + MSG_JAVA_VERSION_LATEST="(dernière mise à jour)" + MSG_JAVA_VERSION_MAX="à %s" + MSG_NO_SUITABLE_JAVA_CHECK="Merci de bien vouloir installer la version de Java requise." + MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..." + MSG_LATER="Plus tard" + MSG_VISIT_JAVA_DOT_COM="Java by Oracle" + MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK" + +# German localization +elif [[ $LANG == de* ]] ; then + MSG_ERROR_LAUNCHING="FEHLER beim Starten von '${CFBundleName}'." + MSG_MISSING_MAINCLASS="Die 'MainClass' ist nicht spezifiziert!\nDie Java-Anwendung kann nicht gestartet werden!" + MSG_JVMVERSION_REQ_INVALID="Die Syntax der angeforderten Java-Version ist ungültig: %s\nBitte kontaktieren Sie den Entwickler der App." + MSG_NO_SUITABLE_JAVA="Es wurde keine passende Java-Version auf Ihrem System gefunden!\nDieses Programm benötigt Java %s" + MSG_JAVA_VERSION_OR_LATER="oder neuer" + MSG_JAVA_VERSION_LATEST="(neuste Unterversion)" + MSG_JAVA_VERSION_MAX="bis %s" + MSG_NO_SUITABLE_JAVA_CHECK="Stellen Sie sicher, dass die angeforderte Java-Version installiert ist." + MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise." + MSG_LATER="Später" + MSG_VISIT_JAVA_DOT_COM="Java von Oracle" + MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK" + +# Simplifyed Chinese localization +elif [[ $LANG == zh* ]] ; then + MSG_ERROR_LAUNCHING="无法启动 '${CFBundleName}'." + MSG_MISSING_MAINCLASS="没有指定 'MainClass'!\nJava程序无法启动!" + MSG_JVMVERSION_REQ_INVALID="Java版本参数语法错误: %s\n请联系该应用的开发者。" + MSG_NO_SUITABLE_JAVA="没有在系统中找到合适的Java版本!\n必须安装Java %s才能够使用该程序!" + MSG_JAVA_VERSION_OR_LATER="及以上版本" + MSG_JAVA_VERSION_LATEST="(最新版本)" + MSG_JAVA_VERSION_MAX="最高为 %s" + MSG_NO_SUITABLE_JAVA_CHECK="请确保系统中安装了所需的Java版本" + MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。" + MSG_LATER="稍后" + MSG_VISIT_JAVA_DOT_COM="Java by Oracle" + MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK" + +# English default localization +else + MSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'." + MSG_MISSING_MAINCLASS="'MainClass' isn't specified!\nJava application cannot be started!" + MSG_JVMVERSION_REQ_INVALID="The syntax of the required Java version is invalid: %s\nPlease contact the App developer." + MSG_NO_SUITABLE_JAVA="No suitable Java version found on your system!\nThis program requires Java %s" + MSG_JAVA_VERSION_OR_LATER="or later" + MSG_JAVA_VERSION_LATEST="(latest update)" + MSG_JAVA_VERSION_MAX="up to %s" + MSG_NO_SUITABLE_JAVA_CHECK="Make sure you install the required Java version." + MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..." + MSG_LATER="Later" + MSG_VISIT_JAVA_DOT_COM="Java by Oracle" + MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK" +fi + + + +# function 'get_java_version_from_cmd()' +# +# returns Java version string from 'java -version' command +# works for both old (1.8) and new (9) version schema +# +# @param1 path to a java JVM executable +# @return the Java version number as displayed in 'java -version' command +################################################################################ +function get_java_version_from_cmd() { + # second sed command strips " and -ea from the version string + echo $("$1" -version 2>&1 | awk '/version/{print $3}' | sed -E 's/"//g;s/-ea//g') +} + + +# function 'extract_java_major_version()' +# +# extract Java major version from a version string +# +# @param1 a Java version number ('1.8.0_45') or requirement string ('1.8+') +# @return the major version (e.g. '7', '8' or '9', etc.) +################################################################################ +function extract_java_major_version() { + echo $(echo "$1" | sed -E 's/^1\.//;s/^([0-9]+)(-ea|(\.[0-9_.]{1,7})?)(-b[0-9]+-[0-9]+)?[+*]?$/\1/') +} + + +# function 'get_comparable_java_version()' +# +# return comparable version for a Java version number or requirement string +# +# @param1 a Java version number ('1.8.0_45') or requirement string ('1.8+') +# @return an 8 digit numeral ('1.8.0_45'->'08000045'; '9.1.13'->'09001013') +################################################################################ +function get_comparable_java_version() { + # cleaning: 1) remove leading '1.'; 2) remove build string (e.g. '-b14-468'); 3) remove 'a-Z' and '-*+' (e.g. '-ea'); 4) replace '_' with '.' + local cleaned=$(echo "$1" | sed -E 's/^1\.//g;s/-b[0-9]+-[0-9]+$//g;s/[a-zA-Z+*\-]//g;s/_/./g') + # splitting at '.' into an array + local arr=( ${cleaned//./ } ) + # echo a string with left padded version numbers + echo "$(printf '%02s' ${arr[0]})$(printf '%03s' ${arr[1]})$(printf '%03s' ${arr[2]})" +} + + +# function 'is_valid_requirement_pattern()' +# +# check whether the Java requirement is a valid requirement pattern +# +# supported requirements are for example: +# - 1.6 requires Java 6 (any update) [1.6, 1.6.0_45, 1.6.0_88] +# - 1.6* requires Java 6 (any update) [1.6, 1.6.0_45, 1.6.0_88] +# - 1.6+ requires Java 6 or higher [1.6, 1.6.0_45, 1.8, 9, etc.] +# - 1.6.0 requires Java 6 (any update) [1.6, 1.6.0_45, 1.6.0_88] +# - 1.6.0_45 requires Java 6u45 [1.6.0_45] +# - 1.6.0_45+ requires Java 6u45 or higher [1.6.0_45, 1.6.0_88, 1.8, etc.] +# - 9 requires Java 9 (any update) [9.0.*, 9.1, 9.3, etc.] +# - 9* requires Java 9 (any update) [9.0.*, 9.1, 9.3, etc.] +# - 9+ requires Java 9 or higher [9.0, 9.1, 10, etc.] +# - 9.1 requires Java 9.1 (any update) [9.1.*, 9.1.2, 9.1.13, etc.] +# - 9.1* requires Java 9.1 (any update) [9.1.*, 9.1.2, 9.1.13, etc.] +# - 9.1+ requires Java 9.1 or higher [9.1, 9.2, 10, etc.] +# - 9.1.3 requires Java 9.1.3 [9.1.3] +# - 9.1.3* requires Java 9.1.3 (any update) [9.1.3] +# - 9.1.3+ requires Java 9.1.3 or higher [9.1.3, 9.1.4, 9.2.*, 10, etc.] +# - 10-ea requires Java 10 (early access release) +# +# unsupported requirement patterns are for example: +# - 1.2, 1.3, 1.9 Java 2, 3 are not supported +# - 1.9 Java 9 introduced a new versioning scheme +# - 6u45 known versioning syntax, but unsupported +# - 9-ea*, 9-ea+ early access releases paired with */+ +# - 9., 9.*, 9.+ version ending with a . +# - 9.1., 9.1.*, 9.1.+ version ending with a . +# - 9.3.5.6 4 part version number is unsupported +# +# @param1 a Java requirement string ('1.8+') +# @return boolean exit code: 0 (is valid), 1 (is not valid) +################################################################################ +function is_valid_requirement_pattern() { + local java_req=$1 + java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?' + java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?' + # test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9) + if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then + return 0 + else + return 1 + fi +} + + + +# determine which JVM to use +############################################ + +# default Apple JRE plugin path (< 1.6) +apple_jre_plugin="/Library/Java/Home/bin/java" +apple_jre_version=$(get_java_version_from_cmd "${apple_jre_plugin}") +# default Oracle JRE plugin path (>= 1.7) +oracle_jre_plugin="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" +oracle_jre_version=$(get_java_version_from_cmd "${oracle_jre_plugin}") + + +# first check system variable "$JAVA_HOME" -> has precedence over any other System JVM +stub_logger '[JavaSearch] Checking for $JAVA_HOME ...' +if [ -n "$JAVA_HOME" ] ; then + stub_logger "[JavaSearch] ... found JAVA_HOME with value $JAVA_HOME" + + # PR 26: Allow specifying "$JAVA_HOME" relative to "$AppPackageFolder" + # which allows for bundling a custom version of Java inside your app! + if [[ $JAVA_HOME == /* ]] ; then + # if "$JAVA_HOME" starts with a Slash it's an absolute path + JAVACMD="$JAVA_HOME/bin/java" + else + # otherwise it's a relative path to "$AppPackageFolder" + JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java" + fi + JAVACMD_version=$(get_comparable_java_version $(get_java_version_from_cmd "${JAVACMD}")) +else + stub_logger "[JavaSearch] ... didn't found JAVA_HOME" +fi + + +# check for any other or a specific Java version +# also if $JAVA_HOME exists but isn't executable +if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then + stub_logger "[JavaSearch] Checking for JavaVirtualMachines on the system ..." + # reset variables + JAVACMD="" + JAVACMD_version="" + + # first check whether JVMVersion string is a valid requirement string + if [ ! -z "${JVMVersion}" ] && ! is_valid_requirement_pattern ${JVMVersion} ; then + MSG_JVMVERSION_REQ_INVALID_EXPANDED=$(printf "${MSG_JVMVERSION_REQ_INVALID}" "${JVMVersion}") + # log exit cause + stub_logger "[EXIT 4] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}" + # display error message with AppleScript + osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_JVMVERSION_REQ_INVALID_EXPANDED}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}" + # exit with error + exit 4 + fi + # then check whether JVMMaxVersion string is a valid requirement string + if [ ! -z "${JVMMaxVersion}" ] && ! is_valid_requirement_pattern ${JVMMaxVersion} ; then + MSG_JVMVERSION_REQ_INVALID_EXPANDED=$(printf "${MSG_JVMVERSION_REQ_INVALID}" "${JVMMaxVersion}") + # log exit cause + stub_logger "[EXIT 5] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}" + # display error message with AppleScript + osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_JVMVERSION_REQ_INVALID_EXPANDED}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}" + # exit with error + exit 5 + fi + + + # find installed JavaVirtualMachines (JDK + JRE) + allJVMs=() + # read JDK's from '/usr/libexec/java_home -V' command + while read -r line; do + version=$(echo $line | awk -F $',' '{print $1;}') + path=$(echo $line | awk -F $'" ' '{print $2;}') + path+="/bin/java" + allJVMs+=("$version:$path") + done < <(/usr/libexec/java_home -V 2>&1 | grep '^[[:space:]]') + # unset while loop variables + unset version path + + # add Apple JRE if available + if [ -x "${apple_jre_plugin}" ] ; then + allJVMs+=("$apple_jre_version:$apple_jre_plugin") + fi + + # add Oracle JRE if available + if [ -x "${oracle_jre_plugin}" ] ; then + allJVMs+=("$oracle_jre_version:$oracle_jre_plugin") + fi + + # debug output + for i in "${allJVMs[@]}" + do + stub_logger "[JavaSearch] ... found JVM: $i" + done + + + # determine JVMs matching the min/max version requirement + minC=$(get_comparable_java_version ${JVMVersion}) + maxC=$(get_comparable_java_version ${JVMMaxVersion}) + matchingJVMs=() + + for i in "${allJVMs[@]}" + do + # split JVM string at ':' delimiter to retain spaces in $path substring + IFS=: arr=($i) ; unset IFS + # [0] JVM version number + ver=${arr[0]} + # comparable JVM version number + comp=$(get_comparable_java_version $ver) + # [1] JVM path + path="${arr[1]}" + # construct string item for adding to the "matchingJVMs" array + item="$comp:$ver:$path" + + # pre-requisite: current version number needs to be greater than min version number + if [ "$comp" -ge "$minC" ] ; then + + # perform max version checks if max version requirement is present + if [ ! -z ${JVMMaxVersion} ] ; then + + # max version requirement ends with '*' modifier + if [[ ${JVMMaxVersion} == *\* ]] ; then + + # use the '*' modifier from the max version string as wildcard for a 'starts with' comparison + # and check whether the current version number starts with the max version wildcard string + if [[ ${ver} == ${JVMMaxVersion} ]]; then + matchingJVMs+=("$item") + + # or whether the current comparable version is lower than the comparable max version + elif [ "$comp" -le "$maxC" ] ; then + matchingJVMs+=("$item") + fi + + # max version requirement ends with '+' modifier -> always add this version if it's greater than $min + # because a max requirement with + modifier doesn't make sense + elif [[ ${JVMMaxVersion} == *+ ]] ; then + matchingJVMs+=("$item") + + # matches 6 zeros at the end of the max version string (e.g. for 1.8, 9) + # -> then the max version string should be treated like with a '*' modifier at the end + #elif [[ ${maxC} =~ ^[0-9]{2}0{6}$ ]] && [ "$comp" -le $(( ${maxC#0} + 999 )) ] ; then + # matchingJVMs+=("$item") + + # matches 3 zeros at the end of the max version string (e.g. for 9.1, 10.3) + # -> then the max version string should be treated like with a '*' modifier at the end + #elif [[ ${maxC} =~ ^[0-9]{5}0{3}$ ]] && [ "$comp" -le "${maxC}" ] ; then + # matchingJVMs+=("$item") + + # matches standard requirements without modifier + elif [ "$comp" -le "$maxC" ]; then + matchingJVMs+=("$item") + fi + + # no max version requirement: + + # min version requirement ends with '+' modifier + # -> always add the current version because it's greater than $min + elif [[ ${JVMVersion} == *+ ]] ; then + matchingJVMs+=("$item") + + # min version requirement ends with '*' modifier + # -> use the '*' modifier from the min version string as wildcard for a 'starts with' comparison + # and check whether the current version number starts with the min version wildcard string + elif [[ ${JVMVersion} == *\* ]] ; then + if [[ ${ver} == ${JVMVersion} ]] ; then + matchingJVMs+=("$item") + fi + + # compare the min version against the current version with an additional * wildcard for a 'starts with' comparison + # -> e.g. add 1.8.0_44 when the requirement is 1.8 + elif [[ ${ver} == ${JVMVersion}* ]] ; then + matchingJVMs+=("$item") + fi + fi + done + # unset for loop variables + unset arr ver comp path item + + # debug output + for i in "${matchingJVMs[@]}" + do + stub_logger "[JavaSearch] ... ... matches all requirements: $i" + done + + + # sort the matching JavaVirtualMachines by version number + # https://stackoverflow.com/a/11789688/1128689 + IFS=$'\n' matchingJVMs=($(sort -nr <<<"${matchingJVMs[*]}")) + unset IFS + + + # get the highest matching JVM + for ((i = 0; i < ${#matchingJVMs[@]}; i++)); + do + # split JVM string at ':' delimiter to retain spaces in $path substring + IFS=: arr=(${matchingJVMs[$i]}) ; unset IFS + # [0] comparable JVM version number + comp=${arr[0]} + # [1] JVM version number + ver=${arr[1]} + # [2] JVM path + path="${arr[2]}" + + # use current value as JAVACMD if it's executable + if [ -x "$path" ] ; then + JAVACMD="$path" + JAVACMD_version=$comp + break + fi + done + # unset for loop variables + unset arr comp ver path +fi + +# log the Java Command and the extracted version number +stub_logger "[JavaCommand] '$JAVACMD'" +stub_logger "[JavaVersion] $(get_java_version_from_cmd "${JAVACMD}")${JAVACMD_version:+ / $JAVACMD_version}" + + + +if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then + + # different error messages when a specific JVM was required + if [ ! -z "${JVMVersion}" ] ; then + # display human readable java version (#28) + java_version_hr=$(echo ${JVMVersion} | sed -E 's/^1\.([0-9+*]+)$/ \1/g' | sed "s/+/ ${MSG_JAVA_VERSION_OR_LATER}/;s/*/ ${MSG_JAVA_VERSION_LATEST}/") + MSG_NO_SUITABLE_JAVA_EXPANDED=$(printf "${MSG_NO_SUITABLE_JAVA}" "${java_version_hr}"). + + if [ ! -z "${JVMMaxVersion}" ] ; then + java_version_hr=$(extract_java_major_version ${JVMVersion}) + java_version_max_hr=$(echo ${JVMMaxVersion} | sed -E 's/^1\.([0-9+*]+)$/ \1/g' | sed "s/+//;s/*/ ${MSG_JAVA_VERSION_LATEST}/") + MSG_NO_SUITABLE_JAVA_EXPANDED="$(printf "${MSG_NO_SUITABLE_JAVA}" "${java_version_hr}") $(printf "${MSG_JAVA_VERSION_MAX}" "${java_version_max_hr}")" + fi + + # log exit cause + stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}" + + # display error message with AppleScript + osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \ + -e "set response to button returned of the result" \ + -e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \ + -e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\"" + # exit with error + exit 3 + + else + # log exit cause + stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}" + # display error message with AppleScript + osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \ + -e "set response to button returned of the result" \ + -e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \ + -e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\"" + # exit with error + exit 1 + fi +fi + + + +# MainClass check +############################################ + +if [ -z "${JVMMainClass}" ]; then + # log exit cause + stub_logger "[EXIT 2] ${MSG_MISSING_MAINCLASS}" + # display error message with AppleScript + osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_MISSING_MAINCLASS}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}" + # exit with error + exit 2 +fi + + + +# execute $JAVACMD and do some preparation +############################################ + +# enable drag&drop to the dock icon +export CFProcessPath="$0" + +# remove Apples ProcessSerialNumber from passthru arguments (#39) +if [[ "$*" == -psn* ]] ; then + ArgsPassthru=() +else + ArgsPassthru=("$@") +fi + +# change to Working Directory based upon Apple/Oracle Plist info +cd "${WorkingDirectory}" || exit 13 +stub_logger "[WorkingDirectory] ${WorkingDirectory}" + +# execute Java and set +# - classpath +# - splash image +# - dock icon +# - app name +# - JVM options / properties (-D) +# - JVM default options (-X) +# - main class +# - main class arguments +# - passthrough arguments from Terminal or Drag'n'Drop to Finder icon +stub_logger "[Exec] \"$JAVACMD\" -cp \"${JVMClassPath}\" -splash:\"${ResourcesFolder}/${JVMSplashFile}\" -Xdock:icon=\"${ResourcesFolder}/${CFBundleIconFile}\" -Xdock:name=\"${CFBundleName}\" ${JVMOptionsArr:+$(printf "'%s' " "${JVMOptionsArr[@]}") }${JVMDefaultOptions:+$JVMDefaultOptions }${JVMMainClass}${MainArgsArr:+ $(printf "'%s' " "${MainArgsArr[@]}")}${ArgsPassthru:+ $(printf "'%s' " "${ArgsPassthru[@]}")}" +exec "${JAVACMD}" \ + -cp "${JVMClassPath}" \ + -splash:"${ResourcesFolder}/${JVMSplashFile}" \ + -Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \ + -Xdock:name="${CFBundleName}" \ + ${JVMOptionsArr:+"${JVMOptionsArr[@]}" }\ + ${JVMDefaultOptions:+$JVMDefaultOptions }\ + "${JVMMainClass}"\ + ${MainArgsArr:+ "${MainArgsArr[@]}"}\ + ${ArgsPassthru:+ "${ArgsPassthru[@]}"} diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..95ad043e --- /dev/null +++ b/pom.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>de.applejuicenet.client</groupId> + <artifactId>AJClientGUI</artifactId> + <version>1</version> + <packaging>pom</packaging> + + <modules> + <module>modules/AJCoreGUI</module> + <module>modules/logviewer</module> + <module>modules/versionchecker</module> + <module>modules/standardpwdlpolicy</module> + </modules> + + <build> + <plugins> + <plugin> + <inherited>false</inherited> + <artifactId>maven-antrun-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <id>antrun.package.archive</id> + <phase>install</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <zip destfile="${basedir}/target/AJCoreGUI.zip"> + <zipfileset dir="${basedir}/resources/" includes="*/*"/> + <zipfileset dir="${basedir}/resources/" includes="AJCoreGUI.exe"/> + <zipfileset dir="${basedir}/modules/AJCoreGUI/target/" includes="AJCoreGUI-*.jar" fullpath="AJCoreGUI.jar"/> + <zipfileset dir="${basedir}/modules/logviewer/target/" includes="logviewer-*.jar" fullpath="plugins/logviewer.jar"/> + <zipfileset dir="${basedir}/modules/versionchecker/target/" includes="versionchecker-*.jar" fullpath="plugins/versionchecker.jar"/> + <zipfileset dir="${basedir}/modules/standardpwdlpolicy/target/" includes="StandardPwdlPolicy-*.jar" fullpath="pwdlpolicies/StandardPwdlPolicy.jar"/> + </zip> + <exec executable="shasum" dir="${basedir}/target/" output="${basedir}/target/AJCoreGUI.zip.sha256.txt"> + <arg line="-a 256"/> + <arg line="AJCoreGUI.zip"/> + </exec> + </target> + </configuration> + </execution> + <execution> + <id>antrun.package.osx</id> + <phase>install</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <zip destfile="${basedir}/target/AJCoreGUI.macOS.zip"> + <zipfileset dir="${basedir}/resources/" prefix="AJCoreGUI.app/Contents/Java/" includes="*/*"/> + <zipfileset dir="${basedir}/modules/AJCoreGUI/target/" includes="AJCoreGUI-*.jar" fullpath="AJCoreGUI.app/Contents/Java/AJCoreGUI.jar"/> + <zipfileset dir="${basedir}/modules/logviewer/target/" includes="logviewer-*.jar" fullpath="AJCoreGUI.app/Contents/Java/plugins/logviewer.jar"/> + <zipfileset dir="${basedir}/modules/versionchecker/target/" includes="versionchecker-*.jar" fullpath="AJCoreGUI.app/Contents/Java/plugins/versionchecker.jar"/> + <zipfileset dir="${basedir}/modules/standardpwdlpolicy/target/" includes="StandardPwdlPolicy-*.jar" fullpath="AJCoreGUI.app/Contents/Java/pwdlpolicies/StandardPwdlPolicy.jar"/> + <zipfileset dir="${basedir}/osx/" includes="Info.plist" prefix="AJCoreGUI.app/Contents/"/> + <zipfileset dir="${basedir}/osx/" includes="AJCoreGUI.icns" prefix="AJCoreGUI.app/Contents/Resources"/> + <zipfileset dir="${basedir}/osx/" includes="universalJavaApplicationStub" prefix="AJCoreGUI.app/Contents/MacOS" filemode="777"/> + </zip> + <exec executable="shasum" dir="${basedir}/target/" output="${basedir}/target/AJCoreGUI.macOS.zip.sha256.txt"> + <arg line="-a 256"/> + <arg line="AJCoreGUI.macOS.zip"/> + </exec> + </target> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/AJClientGUI/AJCoreGUI.exe b/resources/AJCoreGUI.exe similarity index 100% rename from AJClientGUI/AJCoreGUI.exe rename to resources/AJCoreGUI.exe diff --git a/AJClientGUI/icons/abbrechen.gif b/resources/icons/abbrechen.gif similarity index 100% rename from AJClientGUI/icons/abbrechen.gif rename to resources/icons/abbrechen.gif diff --git a/AJClientGUI/icons/about.gif b/resources/icons/about.gif similarity index 100% rename from AJClientGUI/icons/about.gif rename to resources/icons/about.gif diff --git a/AJClientGUI/icons/aelter24h.gif b/resources/icons/aelter24h.gif similarity index 100% rename from AJClientGUI/icons/aelter24h.gif rename to resources/icons/aelter24h.gif diff --git a/AJClientGUI/icons/amigaossymbol.gif b/resources/icons/amigaossymbol.gif similarity index 100% rename from AJClientGUI/icons/amigaossymbol.gif rename to resources/icons/amigaossymbol.gif diff --git a/resources/icons/applejuice.gif b/resources/icons/applejuice.gif new file mode 100644 index 00000000..22255775 Binary files /dev/null and b/resources/icons/applejuice.gif differ diff --git a/AJClientGUI/icons/applejuicebanner.gif b/resources/icons/applejuicebanner.gif similarity index 100% rename from AJClientGUI/icons/applejuicebanner.gif rename to resources/icons/applejuicebanner.gif diff --git a/AJClientGUI/icons/applejuiceinfobanner.gif b/resources/icons/applejuiceinfobanner.gif similarity index 100% rename from AJClientGUI/icons/applejuiceinfobanner.gif rename to resources/icons/applejuiceinfobanner.gif diff --git a/AJClientGUI/icons/archive.gif b/resources/icons/archive.gif similarity index 100% rename from AJClientGUI/icons/archive.gif rename to resources/icons/archive.gif diff --git a/AJClientGUI/icons/bereinigen.gif b/resources/icons/bereinigen.gif similarity index 100% rename from AJClientGUI/icons/bereinigen.gif rename to resources/icons/bereinigen.gif diff --git a/resources/icons/border_invalid.gif b/resources/icons/border_invalid.gif new file mode 100755 index 00000000..f4429743 Binary files /dev/null and b/resources/icons/border_invalid.gif differ diff --git a/AJClientGUI/icons/browsen.gif b/resources/icons/browsen.gif similarity index 100% rename from AJClientGUI/icons/browsen.gif rename to resources/icons/browsen.gif diff --git a/AJClientGUI/icons/chat.gif b/resources/icons/chat.gif similarity index 100% rename from AJClientGUI/icons/chat.gif rename to resources/icons/chat.gif diff --git a/AJClientGUI/icons/clipboard.gif b/resources/icons/clipboard.gif similarity index 100% rename from AJClientGUI/icons/clipboard.gif rename to resources/icons/clipboard.gif diff --git a/AJClientGUI/icons/cool.gif b/resources/icons/cool.gif similarity index 100% rename from AJClientGUI/icons/cool.gif rename to resources/icons/cool.gif diff --git a/AJClientGUI/icons/debug.gif b/resources/icons/debug.gif similarity index 100% rename from AJClientGUI/icons/debug.gif rename to resources/icons/debug.gif diff --git a/AJClientGUI/icons/decrease.gif b/resources/icons/decrease.gif similarity index 100% rename from AJClientGUI/icons/decrease.gif rename to resources/icons/decrease.gif diff --git a/AJClientGUI/icons/deutsch.gif b/resources/icons/deutsch.gif similarity index 100% rename from AJClientGUI/icons/deutsch.gif rename to resources/icons/deutsch.gif diff --git a/AJClientGUI/icons/diskette.gif b/resources/icons/diskette.gif similarity index 100% rename from AJClientGUI/icons/diskette.gif rename to resources/icons/diskette.gif diff --git a/AJClientGUI/icons/download.gif b/resources/icons/download.gif similarity index 100% rename from AJClientGUI/icons/download.gif rename to resources/icons/download.gif diff --git a/AJClientGUI/icons/eek.gif b/resources/icons/eek.gif similarity index 100% rename from AJClientGUI/icons/eek.gif rename to resources/icons/eek.gif diff --git a/AJClientGUI/icons/erneuern.gif b/resources/icons/erneuern.gif similarity index 100% rename from AJClientGUI/icons/erneuern.gif rename to resources/icons/erneuern.gif diff --git a/AJClientGUI/icons/firewall.gif b/resources/icons/firewall.gif similarity index 100% rename from AJClientGUI/icons/firewall.gif rename to resources/icons/firewall.gif diff --git a/AJClientGUI/icons/folderopen.gif b/resources/icons/folderopen.gif similarity index 100% rename from AJClientGUI/icons/folderopen.gif rename to resources/icons/folderopen.gif diff --git a/AJClientGUI/icons/freebsdsymbol.gif b/resources/icons/freebsdsymbol.gif similarity index 100% rename from AJClientGUI/icons/freebsdsymbol.gif rename to resources/icons/freebsdsymbol.gif diff --git a/AJClientGUI/icons/hide.gif b/resources/icons/hide.gif similarity index 100% rename from AJClientGUI/icons/hide.gif rename to resources/icons/hide.gif diff --git a/AJClientGUI/icons/hint.gif b/resources/icons/hint.gif similarity index 100% rename from AJClientGUI/icons/hint.gif rename to resources/icons/hint.gif diff --git a/AJClientGUI/icons/image.gif b/resources/icons/image.gif similarity index 100% rename from AJClientGUI/icons/image.gif rename to resources/icons/image.gif diff --git a/AJClientGUI/icons/increase.gif b/resources/icons/increase.gif similarity index 100% rename from AJClientGUI/icons/increase.gif rename to resources/icons/increase.gif diff --git a/AJClientGUI/icons/info.gif b/resources/icons/info.gif similarity index 100% rename from AJClientGUI/icons/info.gif rename to resources/icons/info.gif diff --git a/AJClientGUI/icons/irixsymbol.gif b/resources/icons/irixsymbol.gif similarity index 100% rename from AJClientGUI/icons/irixsymbol.gif rename to resources/icons/irixsymbol.gif diff --git a/AJClientGUI/icons/iso.gif b/resources/icons/iso.gif similarity index 100% rename from AJClientGUI/icons/iso.gif rename to resources/icons/iso.gif diff --git a/AJClientGUI/icons/juenger24h.gif b/resources/icons/juenger24h.gif similarity index 100% rename from AJClientGUI/icons/juenger24h.gif rename to resources/icons/juenger24h.gif diff --git a/AJClientGUI/icons/laufwerk.gif b/resources/icons/laufwerk.gif similarity index 100% rename from AJClientGUI/icons/laufwerk.gif rename to resources/icons/laufwerk.gif diff --git a/AJClientGUI/icons/led_gray.gif b/resources/icons/led_gray.gif similarity index 100% rename from AJClientGUI/icons/led_gray.gif rename to resources/icons/led_gray.gif diff --git a/AJClientGUI/icons/led_green.gif b/resources/icons/led_green.gif similarity index 100% rename from AJClientGUI/icons/led_green.gif rename to resources/icons/led_green.gif diff --git a/AJClientGUI/icons/led_red.gif b/resources/icons/led_red.gif similarity index 100% rename from AJClientGUI/icons/led_red.gif rename to resources/icons/led_red.gif diff --git a/AJClientGUI/icons/linuxsymbol.gif b/resources/icons/linuxsymbol.gif similarity index 100% rename from AJClientGUI/icons/linuxsymbol.gif rename to resources/icons/linuxsymbol.gif diff --git a/AJClientGUI/icons/macsymbol.gif b/resources/icons/macsymbol.gif similarity index 100% rename from AJClientGUI/icons/macsymbol.gif rename to resources/icons/macsymbol.gif diff --git a/AJClientGUI/icons/meinshare.gif b/resources/icons/meinshare.gif similarity index 100% rename from AJClientGUI/icons/meinshare.gif rename to resources/icons/meinshare.gif diff --git a/AJClientGUI/icons/mmonitor.gif b/resources/icons/mmonitor.gif similarity index 100% rename from AJClientGUI/icons/mmonitor.gif rename to resources/icons/mmonitor.gif diff --git a/AJClientGUI/icons/movie.gif b/resources/icons/movie.gif similarity index 100% rename from AJClientGUI/icons/movie.gif rename to resources/icons/movie.gif diff --git a/AJClientGUI/icons/netwaresymbol.gif b/resources/icons/netwaresymbol.gif similarity index 100% rename from AJClientGUI/icons/netwaresymbol.gif rename to resources/icons/netwaresymbol.gif diff --git a/AJClientGUI/icons/netzwerk.gif b/resources/icons/netzwerk.gif similarity index 100% rename from AJClientGUI/icons/netzwerk.gif rename to resources/icons/netzwerk.gif diff --git a/AJClientGUI/icons/neuedateiliste.gif b/resources/icons/neuedateiliste.gif similarity index 100% rename from AJClientGUI/icons/neuedateiliste.gif rename to resources/icons/neuedateiliste.gif diff --git a/AJClientGUI/icons/notshared.gif b/resources/icons/notshared.gif similarity index 100% rename from AJClientGUI/icons/notshared.gif rename to resources/icons/notshared.gif diff --git a/AJClientGUI/icons/openbsdsymbol.gif b/resources/icons/openbsdsymbol.gif similarity index 100% rename from AJClientGUI/icons/openbsdsymbol.gif rename to resources/icons/openbsdsymbol.gif diff --git a/AJClientGUI/icons/opt_ansicht.gif b/resources/icons/opt_ansicht.gif similarity index 100% rename from AJClientGUI/icons/opt_ansicht.gif rename to resources/icons/opt_ansicht.gif diff --git a/AJClientGUI/icons/opt_passwort.gif b/resources/icons/opt_passwort.gif similarity index 100% rename from AJClientGUI/icons/opt_passwort.gif rename to resources/icons/opt_passwort.gif diff --git a/AJClientGUI/icons/opt_plugins.gif b/resources/icons/opt_plugins.gif similarity index 100% rename from AJClientGUI/icons/opt_plugins.gif rename to resources/icons/opt_plugins.gif diff --git a/AJClientGUI/icons/opt_proxy.gif b/resources/icons/opt_proxy.gif similarity index 100% rename from AJClientGUI/icons/opt_proxy.gif rename to resources/icons/opt_proxy.gif diff --git a/AJClientGUI/icons/opt_standard.gif b/resources/icons/opt_standard.gif similarity index 100% rename from AJClientGUI/icons/opt_standard.gif rename to resources/icons/opt_standard.gif diff --git a/AJClientGUI/icons/opt_verbindung.gif b/resources/icons/opt_verbindung.gif similarity index 100% rename from AJClientGUI/icons/opt_verbindung.gif rename to resources/icons/opt_verbindung.gif diff --git a/AJClientGUI/icons/optionen.gif b/resources/icons/optionen.gif similarity index 100% rename from AJClientGUI/icons/optionen.gif rename to resources/icons/optionen.gif diff --git a/AJClientGUI/icons/os2symbol.gif b/resources/icons/os2symbol.gif similarity index 100% rename from AJClientGUI/icons/os2symbol.gif rename to resources/icons/os2symbol.gif diff --git a/AJClientGUI/icons/partliste.gif b/resources/icons/partliste.gif similarity index 100% rename from AJClientGUI/icons/partliste.gif rename to resources/icons/partliste.gif diff --git a/AJClientGUI/icons/pause.gif b/resources/icons/pause.gif similarity index 100% rename from AJClientGUI/icons/pause.gif rename to resources/icons/pause.gif diff --git a/AJClientGUI/icons/pdf.gif b/resources/icons/pdf.gif similarity index 100% rename from AJClientGUI/icons/pdf.gif rename to resources/icons/pdf.gif diff --git a/AJClientGUI/icons/server.gif b/resources/icons/server.gif similarity index 100% rename from AJClientGUI/icons/server.gif rename to resources/icons/server.gif diff --git a/AJClientGUI/icons/serverloeschen.gif b/resources/icons/serverloeschen.gif similarity index 100% rename from AJClientGUI/icons/serverloeschen.gif rename to resources/icons/serverloeschen.gif diff --git a/AJClientGUI/icons/serverneu.gif b/resources/icons/serverneu.gif similarity index 100% rename from AJClientGUI/icons/serverneu.gif rename to resources/icons/serverneu.gif diff --git a/AJClientGUI/icons/serververbinden.gif b/resources/icons/serververbinden.gif similarity index 100% rename from AJClientGUI/icons/serververbinden.gif rename to resources/icons/serververbinden.gif diff --git a/AJClientGUI/icons/serververbunden.gif b/resources/icons/serververbunden.gif similarity index 100% rename from AJClientGUI/icons/serververbunden.gif rename to resources/icons/serververbunden.gif diff --git a/AJClientGUI/icons/serverversuche.gif b/resources/icons/serverversuche.gif similarity index 100% rename from AJClientGUI/icons/serverversuche.gif rename to resources/icons/serverversuche.gif diff --git a/AJClientGUI/icons/sharedwosub.gif b/resources/icons/sharedwosub.gif similarity index 100% rename from AJClientGUI/icons/sharedwosub.gif rename to resources/icons/sharedwosub.gif diff --git a/AJClientGUI/icons/sharedwsub.gif b/resources/icons/sharedwsub.gif similarity index 100% rename from AJClientGUI/icons/sharedwsub.gif rename to resources/icons/sharedwsub.gif diff --git a/AJClientGUI/icons/skull.gif b/resources/icons/skull.gif similarity index 100% rename from AJClientGUI/icons/skull.gif rename to resources/icons/skull.gif diff --git a/AJClientGUI/icons/somethingshared.gif b/resources/icons/somethingshared.gif similarity index 100% rename from AJClientGUI/icons/somethingshared.gif rename to resources/icons/somethingshared.gif diff --git a/AJClientGUI/icons/sound.gif b/resources/icons/sound.gif similarity index 100% rename from AJClientGUI/icons/sound.gif rename to resources/icons/sound.gif diff --git a/AJClientGUI/icons/soundoff.gif b/resources/icons/soundoff.gif similarity index 100% rename from AJClientGUI/icons/soundoff.gif rename to resources/icons/soundoff.gif diff --git a/AJClientGUI/icons/soundon.gif b/resources/icons/soundon.gif similarity index 100% rename from AJClientGUI/icons/soundon.gif rename to resources/icons/soundon.gif diff --git a/AJClientGUI/icons/speichern.gif b/resources/icons/speichern.gif similarity index 100% rename from AJClientGUI/icons/speichern.gif rename to resources/icons/speichern.gif diff --git a/AJClientGUI/icons/splashscreen.gif b/resources/icons/splashscreen.gif similarity index 100% rename from AJClientGUI/icons/splashscreen.gif rename to resources/icons/splashscreen.gif diff --git a/AJClientGUI/icons/splashscreen.properties b/resources/icons/splashscreen.properties similarity index 100% rename from AJClientGUI/icons/splashscreen.properties rename to resources/icons/splashscreen.properties diff --git a/AJClientGUI/icons/start.gif b/resources/icons/start.gif similarity index 100% rename from AJClientGUI/icons/start.gif rename to resources/icons/start.gif diff --git a/AJClientGUI/icons/suchen.gif b/resources/icons/suchen.gif similarity index 100% rename from AJClientGUI/icons/suchen.gif rename to resources/icons/suchen.gif diff --git a/AJClientGUI/icons/sunossymbol.gif b/resources/icons/sunossymbol.gif similarity index 100% rename from AJClientGUI/icons/sunossymbol.gif rename to resources/icons/sunossymbol.gif diff --git a/AJClientGUI/icons/text.gif b/resources/icons/text.gif similarity index 100% rename from AJClientGUI/icons/text.gif rename to resources/icons/text.gif diff --git a/AJClientGUI/icons/tree.gif b/resources/icons/tree.gif similarity index 100% rename from AJClientGUI/icons/tree.gif rename to resources/icons/tree.gif diff --git a/AJClientGUI/icons/treeIndirekt.gif b/resources/icons/treeIndirekt.gif similarity index 100% rename from AJClientGUI/icons/treeIndirekt.gif rename to resources/icons/treeIndirekt.gif diff --git a/AJClientGUI/icons/treeRoot.gif b/resources/icons/treeRoot.gif similarity index 100% rename from AJClientGUI/icons/treeRoot.gif rename to resources/icons/treeRoot.gif diff --git a/AJClientGUI/icons/treeUebertrage.gif b/resources/icons/treeUebertrage.gif similarity index 100% rename from AJClientGUI/icons/treeUebertrage.gif rename to resources/icons/treeUebertrage.gif diff --git a/AJClientGUI/icons/treeWarteschlange.gif b/resources/icons/treeWarteschlange.gif similarity index 100% rename from AJClientGUI/icons/treeWarteschlange.gif rename to resources/icons/treeWarteschlange.gif diff --git a/AJClientGUI/icons/umbenennen.gif b/resources/icons/umbenennen.gif similarity index 100% rename from AJClientGUI/icons/umbenennen.gif rename to resources/icons/umbenennen.gif diff --git a/AJClientGUI/icons/unbekanntsymbol.gif b/resources/icons/unbekanntsymbol.gif similarity index 100% rename from AJClientGUI/icons/unbekanntsymbol.gif rename to resources/icons/unbekanntsymbol.gif diff --git a/AJClientGUI/icons/update.gif b/resources/icons/update.gif similarity index 100% rename from AJClientGUI/icons/update.gif rename to resources/icons/update.gif diff --git a/AJClientGUI/icons/upload.gif b/resources/icons/upload.gif similarity index 100% rename from AJClientGUI/icons/upload.gif rename to resources/icons/upload.gif diff --git a/AJClientGUI/icons/verbinden.gif b/resources/icons/verbinden.gif similarity index 100% rename from AJClientGUI/icons/verbinden.gif rename to resources/icons/verbinden.gif diff --git a/AJClientGUI/icons/verbindungUnbekannt.gif b/resources/icons/verbindungUnbekannt.gif similarity index 100% rename from AJClientGUI/icons/verbindungUnbekannt.gif rename to resources/icons/verbindungUnbekannt.gif diff --git a/AJClientGUI/icons/verzeichnislink.gif b/resources/icons/verzeichnislink.gif similarity index 100% rename from AJClientGUI/icons/verzeichnislink.gif rename to resources/icons/verzeichnislink.gif diff --git a/AJClientGUI/icons/vlc.gif b/resources/icons/vlc.gif similarity index 100% rename from AJClientGUI/icons/vlc.gif rename to resources/icons/vlc.gif diff --git a/AJClientGUI/icons/warnung.gif b/resources/icons/warnung.gif similarity index 100% rename from AJClientGUI/icons/warnung.gif rename to resources/icons/warnung.gif diff --git a/AJClientGUI/icons/warten.gif b/resources/icons/warten.gif similarity index 100% rename from AJClientGUI/icons/warten.gif rename to resources/icons/warten.gif diff --git a/AJClientGUI/icons/web.gif b/resources/icons/web.gif similarity index 100% rename from AJClientGUI/icons/web.gif rename to resources/icons/web.gif diff --git a/AJClientGUI/icons/winsymbol.gif b/resources/icons/winsymbol.gif similarity index 100% rename from AJClientGUI/icons/winsymbol.gif rename to resources/icons/winsymbol.gif diff --git a/AJClientGUI/icons/wizardbanner.gif b/resources/icons/wizardbanner.gif similarity index 100% rename from AJClientGUI/icons/wizardbanner.gif rename to resources/icons/wizardbanner.gif diff --git a/AJClientGUI/icons/zielordner.gif b/resources/icons/zielordner.gif similarity index 100% rename from AJClientGUI/icons/zielordner.gif rename to resources/icons/zielordner.gif diff --git a/AJClientGUI/language/deutsch.gif b/resources/language/deutsch.gif similarity index 100% rename from AJClientGUI/language/deutsch.gif rename to resources/language/deutsch.gif diff --git a/AJClientGUI/language/deutsch.properties b/resources/language/deutsch.properties similarity index 64% rename from AJClientGUI/language/deutsch.properties rename to resources/language/deutsch.properties index bbb96228..0d4d6ab8 100644 --- a/AJClientGUI/language/deutsch.properties +++ b/resources/language/deutsch.properties @@ -1,48 +1,48 @@ # #Mon Jan 12 09:26:29 CET 2009 -addserverform.caption=Server hinzuf\u00FCgen +addserverform.caption=Server hinzufügen addserverform.okbtn.caption=OK addserverform.portlbl.caption=Port addserverform.serverlbl.caption=DynIP vom Server -assistant.backbutton.caption=Zur\u00FCck +assistant.backbutton.caption=Zurück assistant.caption=Willkommen bei Applejuice -assistant.closebutton.caption=Schlie\u00DFen +assistant.closebutton.caption=Schließen assistant.finishtext=Ende assistant.Label1.caption=Willkommen bei appleJuice assistant.Label2.caption=Falls du appleJuice vorher noch nicht benutzt hast, kann dir dieser Assistent bei den Einstellungen helfen. -assistant.Label3.caption=Fortgeschrittene Anwender k\u00F6nnen die Einstellungen in den Optionen vornehmen. Klicke auf Schie\u00DFen um den Assistent jederzeit zu beenden. -assistant.Label4.caption=F\u00FCr die optimale Performance ben\u00F6tigt appleJuice noch ein paar kleine Informationen \u00FCber deine Internetverbindung. -assistant.Label5.caption=W\u00E4hle die Art der Verbindung\: -assistant.Label6.caption=Das wars \! appleJuice ist konfiguriert, um auf deinen Computer zu arbeiten. Solltest du die Einstellungen wieder \u00E4ndern wollen, kannst du den Assistenten durch den Link auf der Startseite wieder starten. Viel Spa\u00DF mit appleJuice \!\!\! ;-) +assistant.Label3.caption=Fortgeschrittene Anwender können die Einstellungen in den Optionen vornehmen. Klicke auf Schießen um den Assistent jederzeit zu beenden. +assistant.Label4.caption=Für die optimale Performance benötigt appleJuice noch ein paar kleine Informationen über deine Internetverbindung. +assistant.Label5.caption=Wäle die Art der Verbindung\: +assistant.Label6.caption=Das wars \! appleJuice ist konfiguriert, um auf deinen Computer zu arbeiten. Solltest du die Einstellungen wieder ändern wollen, kannst du den Assistenten durch den Link auf der Startseite wieder starten. Viel Spaß mit appleJuice \!\!\! ;-) assistant.Label7.caption=Bitte gebe deinen Benutzernamen ein. "nonick" ist ein nicht erlaubter Benutzername. -assistant.Label8.caption=Bitte w\u00E4hle eine Sprache. +assistant.Label8.caption=Bitte wäle eine Sprache. assistant.nextbutton.caption=Weiter assistant.nexttext=Weiter chatform.caption=Chat chatform.sendbtn.caption=Senden -closeform.caption=Schlie\u00DFen -closeform.closecoreradio.caption=GUI und Core schlie\u00DFen -closeform.closeradio.caption=GUI schlie\u00DFen +closeform.caption=Schließen +closeform.closecoreradio.caption=GUI und Core schließen +closeform.closeradio.caption=GUI schließen closeform.minimizeradio.caption=minimiere ins Tray closeform.neveraskbox.caption=Nie wieder Fragen closeform.okbtn.caption=OK closeform.reconnectradio.caption=Zum Core neu verbinden connect.Button1.caption=OK -connect.Button2.caption=Abbruch/Schlie\u00DFen +connect.Button2.caption=Abbruch/Schließen connect.caption=Verbinde zum Core.... connect.CheckBox1.caption=Nie wieder fragen -connect.infolabel.caption=Du hast 127.0.0.1 f\u00FCr den Core eingegeben, aber er wurde nicht gefunden. Der Core wird gestartet, wenn du auf OK klickst. +connect.infolabel.caption=Du hast 127.0.0.1 für den Core eingegeben, aber er wurde nicht gefunden. Der Core wird gestartet, wenn du auf OK klickst. connect.Label1.caption=Core -connect.Label2.caption=Pa\u00DFwort +connect.Label2.caption=Paßwort connect.remember.caption=Speichern einstform.autoconn.caption=Automatisch Verbinden einstform.browallow.caption=Erlaube das Browsen einstform.Button1.caption=OK einstform.Button2.caption=Abbruch -einstform.Button3.caption=Password \u00E4ndern +einstform.Button3.caption=Password ändern einstform.caption=Optionen einstform.closeask.caption=Fragen, wie Applejuice geschlossen werden soll? -einstform.connask.caption=\u00DCberpr\u00FCfe Verbindung +einstform.connask.caption=Überprüfe Verbindung einstform.connectionsheet.caption=Verbindung einstform.downcolumns.caption=Spalten in der Downloadliste einstform.dwncol1.caption=Bereits geladen @@ -50,17 +50,17 @@ einstform.dwncol2.caption=Prozent fertig geladen einstform.dwncol3.caption=Noch zu laden einstform.graphicview.caption=Graphische Anzeige, was schon geladen worden ist einstform.GroupBox1.caption=Statusbar -einstform.Label1.caption=Achtung\! Alle Benutzer k\u00F6nnen die Dateien sehen, die du anbietest\! +einstform.Label1.caption=Achtung\! Alle Benutzer können die Dateien sehen, die du anbietest\! einstform.Label10.caption=Sprache einstform.Label11.caption=Hier sind alle geladenen Plugins aufgelistet einstform.Label12.caption=Aktualisiere alle (in Sekunden) 0 \= Keine Aktualisierung einstform.Label13.caption=Max. Downloadgeschwindigkeit in kb/s -einstform.Label14.caption=Sendepriorit\u00E4t der Downloads -einstform.Label15.caption=Altes Pa\u00DFwort -einstform.Label16.caption=Neues Pa\u00DFwort -einstform.Label17.caption=Password best\u00E4tigen +einstform.Label14.caption=Sendepriorität der Downloads +einstform.Label15.caption=Altes Paßwort +einstform.Label16.caption=Neues Paßwort +einstform.Label17.caption=Password bestätigen einstform.Label18.caption=Ping Grenze wegen den Uploadslots in ms -einstform.Label19.caption=URL f\u00FCrs pingen wegen den Uploadslots +einstform.Label19.caption=URL fürs pingen wegen den Uploadslots einstform.Label2.caption=Temp-Verzeichnis einstform.Label3.caption=Core-Port einstform.Label4.caption=Max. Verbindungen @@ -70,21 +70,21 @@ einstform.Label7.caption=Fertige Dateien einstform.Label8.caption=Benutzername einstform.Label9.caption=Anzahl der Dateien beim Download einstform.languagesheet.caption=Sprache -einstform.pwsheet.caption=Pa\u00DFwort +einstform.pwsheet.caption=Paßwort einstform.questionsheet.caption=Abfrage einstform.securitysheet.caption=Sicherheit einstform.simplebar.caption=einfache Statusleiste einstform.standardsheet.caption=Standard einstform.TabSheet1.caption=Plugins einstform.visualsheet.caption=Anzeige -javagui.checkupdate.keineNeueVersion=Es ist keine neuere Version verf\u00FCgbar. -javagui.downloadform.aktiveuebertragung=aktive \u00DCbertragung +javagui.checkupdate.keineNeueVersion=Es ist keine neuere Version verfügbar. +javagui.downloadform.aktiveuebertragung=aktive Übertragung javagui.downloadform.bereitsgeladen='%s' bereits herunter geladen. javagui.downloadform.datawirderstellt=*.data wird erstellt javagui.downloadform.dreckigerrest=dreckiger Rest javagui.downloadform.eigeneslimiterreicht=Eigenes Limit erreicht -javagui.downloadform.einfuegen=Einf\u00FCgen -javagui.downloadform.falscherlink='%s' ist ung\u00FCltig. +javagui.downloadform.einfuegen=Einfügen +javagui.downloadform.falscherlink='%s' ist ungültig. javagui.downloadform.fehlerbeimfertigstellen=Fehler beim Fertigstellen javagui.downloadform.getlinkwithsources=Link mit Source in Ablage kopieren javagui.downloadform.indverbindungabgelehnt=indirekte Verbindung abgelehnt @@ -95,14 +95,14 @@ javagui.downloadform.partlisteanzeigen=Partliste anzeigen javagui.downloadform.quellen=\ Quelle(n) javagui.downloadform.sonstigerlinkfehlerkurz=Coreseitiger Fehler javagui.downloadform.sonstigerlinkfehlerlang=Es wurde coreseitig ein Fehler beim Starten des Downloads gemeldet. Bitte schauen Sie in die Core-Konsole. -javagui.downloadform.uebertragen=% \u00FCbertragen -javagui.downloadform.verbindungunmoeglich=keine Verbindung m\u00F6glich -javagui.downloadform.verfuegbar=%s% verf\u00FCgbar +javagui.downloadform.uebertragen=% übertragen +javagui.downloadform.verbindungunmoeglich=keine Verbindung möglich +javagui.downloadform.verfuegbar=%s% verfügbar javagui.downloadform.waitnodetext=bitte warten... javagui.downloadform.wartendedownloads=in Warteschlange javagui.downloadform.warteschlangevoll=Warteschlange voll javagui.downloadform.zielverzeichnis=Zielverzeichnis -javagui.downloadtab.btnOK=\u00DCbernehmen +javagui.downloadtab.btnOK=Übernehmen javagui.downloadtab.label1=Automatischer Powerdownload javagui.downloadtab.pdlAb=ab javagui.downloadtab.pdlBis=bis @@ -113,11 +113,11 @@ javagui.mainform.fortsetzen=Fortsetzen javagui.mainform.keinserver=<Kein Server> javagui.mainform.nichtverbunden=Nicht verbunden... javagui.mainform.pause=Pause -javagui.mainform.themesupportnachricht=Bist du dir sicher? Das GUI m\u00FCsste neu gestartet werden. +javagui.mainform.themesupportnachricht=Bist du dir sicher? Das GUI müsste neu gestartet werden. javagui.mainform.verbinden=Verbinden... javagui.mainform.verbunden=Verbunden... javagui.menu.aktivieren=aktivieren -javagui.menu.bestaetigung=Bist du sicher, dass du den Core beenden willst? Du wirst die Kontrolle \u00FCber den Core verlieren\! +javagui.menu.bestaetigung=Bist du sicher, dass du den Core beenden willst? Du wirst die Kontrolle über den Core verlieren\! javagui.menu.corebeenden=Core beenden javagui.menu.corebeendenhint=Mit dieser Funktionen kannst du deinen Core beenden. javagui.menu.dateiliste=Dateiliste importieren @@ -132,10 +132,10 @@ javagui.options.ansicht.caption=Ansicht javagui.options.ansicht.downloadansicht=Partliste bei Mausklick anzeigen javagui.options.ansicht.fertigerdownload=fertiger Download javagui.options.ansicht.hintergrundfarben=Hintergrundfarben -javagui.options.ansicht.hintergrundfarbewaehlen=Hintergrundfarbe w\u00E4hlen +javagui.options.ansicht.hintergrundfarbewaehlen=Hintergrundfarbe wälen javagui.options.ansicht.quelle=Quelle -javagui.options.ansicht.ttipp_farbewaehlen=Um die Farbe zu \u00E4ndern, klicke auf die Farbe|und w\u00E4hle eine neue Farbe aus. -javagui.options.ansicht.zeigestartscreen=Startscreen beim n\u00E4chsten Start des GUI anzeigen? +javagui.options.ansicht.ttipp_farbewaehlen=Um die Farbe zu ändern, klicke auf die Farbe|und wäle eine neue Farbe aus. +javagui.options.ansicht.zeigestartscreen=Startscreen beim nächsten Start des GUI anzeigen? javagui.options.ansicht.zeigetooltipps=Tooltipp anzeigen javagui.options.logging.debug=Debuginfos javagui.options.logging.info=Infos @@ -145,7 +145,7 @@ javagui.options.plugins.autor=Autor javagui.options.plugins.beschreibung=Beschreibung javagui.options.plugins.einstellungen=Einstellungen javagui.options.plugins.name=Name -javagui.options.plugins.schliessen=Schlie\u00DFen +javagui.options.plugins.schliessen=Schließen javagui.options.plugins.version=Version javagui.options.proxy.benutzername=Benutzername javagui.options.proxy.caption=Proxy @@ -154,22 +154,19 @@ javagui.options.proxy.passwort=Passwort javagui.options.proxy.port=Port javagui.options.proxy.verwenden=wird verwendet javagui.options.remote.caption=Fernzugriff -javagui.options.remote.fehlertext=Du hast ung\u00FCltige Angaben im Bereich Fernzugriff gemacht. Dieser Bereich wurde nicht gespeichert. +javagui.options.remote.fehlertext=Du hast ungültige Angaben im Bereich Fernzugriff gemacht. Dieser Bereich wurde nicht gespeichert. javagui.options.remote.host=Host javagui.options.remote.passwortAlt=Altes Passwort javagui.options.remote.passwortNeu=Neues Passwort javagui.options.remote.verwenden=Fernzugriff verwenden javagui.options.standard.ladeplugins=Plugins beim Start laden javagui.options.standard.standardbrowser=Standardbrowser -javagui.options.standard.startemitstandard=\u00D6ffne mit Standardprogramm -javagui.options.standard.ttipp_nick=Diese Einstellung wird erst nach einem|erneuten Verbindungsaufbau zu einem Server g\u00FCltig. -javagui.options.standard.ttipp_port=Eine \u00C4nderung hat die Beendigung aller|offenen Chatsessions, Uploads und eventuell|der aktuellen Downloads zur Folge.|Nach \u00C4nderung dieser Einstellung ist ein erneutes|Verbinden mit einem Server notwendig.|1024<Port<\=32000 -javagui.options.standard.ttipp_temp=Nur \u00E4nderbar, wenn die Downloadliste leer ist.|Bitte kein Unterverzeichnis von Incoming und|kein Verzeichnis einer anderen Anwendung verwenden. -javagui.options.standard.ttipp_xmlport=Kann die Fernsteuerung evtl. deaktivieren,|wenn der Port ung\u00FCltig oder bereits belegt ist.|\u00C4nderung macht Neustart und Neueingabe des Passwortes erforderlich.|1024<Port<\=32000 -javagui.options.standard.updateinfo0=Versionsupdate -javagui.options.standard.updateinfo1=wichtige \u00C4nderungen -javagui.options.standard.updateinfo2=kosmetischen Korrekturen -javagui.options.standard.updateinfotext=Updatebenachrichtigung bei +javagui.options.standard.startemitstandard=Öffne mit Standardprogramm +javagui.options.standard.ttipp_nick=Diese Einstellung wird erst nach einem|erneuten Verbindungsaufbau zu einem Server gültig. +javagui.options.standard.ttipp_port=Eine Änderung hat die Beendigung aller|offenen Chatsessions, Uploads und eventuell|der aktuellen Downloads zur Folge.|Nach Änderung dieser Einstellung ist ein erneutes|Verbinden mit einem Server notwendig.|1024<Port<\=32000 +javagui.options.standard.ttipp_temp=Nur änderbar, wenn die Downloadliste leer ist.|Bitte kein Unterverzeichnis von Incoming und|kein Verzeichnis einer anderen Anwendung verwenden. +javagui.options.standard.ttipp_xmlport=Kann die Fernsteuerung evtl. deaktivieren,|wenn der Port ungültig oder bereits belegt ist.|Änderung macht Neustart und Neueingabe des Passwortes erforderlich.|1024<Port<\=32000 +javagui.options.standard.updateinfotext=Updatebenachrichtigung javagui.options.standard.xmlport=XML-Port javagui.options.verbindung.label3=kb/s pro Uploadslot javagui.options.verbindung.label5=Max. neue Verbindungen pro 10 Sek. (1<\=x<\=200) @@ -178,61 +175,60 @@ javagui.options.verbindung.labelwizard=Wizard starten javagui.searchform.durchsuchteclients=%i durchsuchte Cores javagui.searchform.gefundenedateien=%i gefundene Dateien javagui.searchform.offenesuchen=%i verbleibende Clients -javagui.serverform.aelter24h=L\u00E4nger als 24Std nicht gesehen +javagui.serverform.aelter24h=Länger als 24Std nicht gesehen javagui.serverform.col4caption=Verbindungsversuche javagui.serverform.juenger24h=In den letzten 24Std gesehen javagui.serverform.verbinden=Versuche zu verbinden javagui.serverform.verbunden=Verbunden -javagui.serverform.warnungnachricht=Du bist erst seit %s Minuten verbunden. Wenn du nicht l\u00E4nger als 30 Minuten verbunden bist, handelst du dir eine 30 Minuten-Sperre ein. Fortfahren ? +javagui.serverform.warnungnachricht=Du bist erst seit %s Minuten verbunden. Wenn du nicht länger als 30 Minuten verbunden bist, handelst du dir eine 30 Minuten-Sperre ein. Fortfahren ? javagui.shareform.anzahlShare=%i Dateien / %s im Share javagui.shareform.downloadanfragen=Downloadanfragen javagui.shareform.letzteanfrage=Letzte Anfrage javagui.shareform.linkalsubbcode=Link als UBB-Code in Ablage kopieren javagui.shareform.suchanfragen=Suchanfragen -javagui.startup.corezualt=Der verwendete Core ist zu alt. Ben\u00F6tigt wird eine Version ab %s. Das GUI wird beendet. +javagui.startup.corezualt=Der verwendete Core ist zu alt. Benötigt wird eine Version ab %s. Das GUI wird beendet. javagui.startup.fehlversuch=Coreverbindung fehlgeschlagen -javagui.startup.newversionnachricht=Eine neue Version von Applejuice wurde gefunden (%s). Bitte verwende keine alte Version. +javagui.startup.newversionnachricht=Eine neue Version des appleJuice GUI wurde gefunden (%s). javagui.startup.newversiontitel=Neue Version gefunden javagui.startup.showdialog=nie wieder anzeigen -javagui.startup.sonstigeversionen=Sonstige javagui.startup.trayfehler=TrayIcon12.dll wurde nicht gefunden. Das Programm startet ohne TrayIcon. -javagui.startup.ueberpruefeEinst=Bitte \u00FCberpr\u00FCfe deine Angaben\: -javagui.startup.updatefehlernachricht=Du musst einen g\u00FCltigen Webbrowser ausw\u00E4hlen, um diese Funktion nutzen zu k\u00F6nnen. -javagui.startup.verbindungsfehler=Es war nicht m\u00F6glich eine Verbindung mit dem Core auf '%s' aufzubauen. AppleJuice wird beendet. -javagui.startup.windowsversion=Windowsversion -javagui.tooltipps.autopowerdownload=Durch Aktivieren des automatischen Powerdownloads kannst du festlegen, ab|wie vielen Credits der Powerdownload aktiviert wird und wann er sich wieder|ausschaltet.|Der Powerdownload ber\u00FCcksichtigt immer die am meisten geladenen Dateien.|Das GUI muss laufen. -javagui.tooltipps.powerdownload=Durch Aktivieren des Powerdownloads kann die Chance etwas zu laden erh\u00F6ht werden.|Je mehr Credits du einsetzt, desto h\u00F6her rutschst du in der Warteschlange. +javagui.startup.ueberpruefeEinst=Bitte überprüfe deine Angaben\: +javagui.startup.updatefehlernachricht=Du musst einen gültigen Webbrowser auswälen, um diese Funktion nutzen zu können. +javagui.startup.verbindungsfehler=Es war nicht möglich eine Verbindung mit dem Core auf '%s' aufzubauen. AppleJuice wird beendet. +javagui.startup.newversion=Download +javagui.tooltipps.autopowerdownload=Durch Aktivieren des automatischen Powerdownloads kannst du festlegen, ab|wie vielen Credits der Powerdownload aktiviert wird und wann er sich wieder|ausschaltet.|Der Powerdownload berücksichtigt immer die am meisten geladenen Dateien.|Das GUI muss laufen. +javagui.tooltipps.powerdownload=Durch Aktivieren des Powerdownloads kann die Chance etwas zu laden erhöht werden.|Je mehr Credits du einsetzt, desto höher rutschst du in der Warteschlange. javagui.uploadform.columnwasserstand=Wasserstand javagui.uploadform.dreckigerrest=dreckiger Rest javagui.uploadform.ladendeuploads=aktive Uploads javagui.uploadform.wartendeuploads=wartende Uploads -javagui.wizard.ende=Schlie\u00DFen -javagui.wizard.schritt1.label1=Bitte w\u00E4hle deine Sprache. +javagui.wizard.ende=Schließen +javagui.wizard.schritt1.label1=Bitte wäle deine Sprache. javagui.wizard.schritt2.label1=Willkommen bei appleJuice. javagui.wizard.schritt2.label2=Wenn du appleJuice noch nie verwendet hast, kann dir dieser Wizard die wichtigsten Einstellungen abnehmen. -javagui.wizard.schritt2.label3=Wenn du ein erfahrener Benutzer bist, kannst du optional alle Einstellungen \u00FCber das Optionenmen\u00FC t\u00E4tigen. Zum Beenden des Wizards kannst du zu jeder Zeit Schlie\u00DFen anklicken. -javagui.wizard.schritt3.label1=Bitte w\u00E4hle eine im Netzwerk sichtbare Benutzerkennung. "nonick" ist keine g\u00FCltige Benutzerkennung. -javagui.wizard.schritt4.label1=F\u00FCr die optimale Performance ben\u00F6tigt appleJuice noch ein paar kleine Informationen \u00FCber deine Internetverbindung. -javagui.wizard.schritt4.label2=W\u00E4hle die Art deiner Internetverbindung\: -javagui.wizard.schritt5.label1=Das wars\! appleJuice ist konfiguriert, um auf deinem Computer zu arbeiten. Solltest du die Einstellungen wieder \u00E4ndern wollen, kannst du den Wizard \u00FCber das Optionenmen\u00FC erneut starten. -javagui.wizard.schritt5.label2=Viel Spa\u00DF mit appleJuice\! ;-) +javagui.wizard.schritt2.label3=Wenn du ein erfahrener Benutzer bist, kannst du optional alle Einstellungen über das Optionenmenü tätigen. Zum Beenden des Wizards kannst du zu jeder Zeit Schließen anklicken. +javagui.wizard.schritt3.label1=Bitte wäle eine im Netzwerk sichtbare Benutzerkennung. "nonick" ist keine gültige Benutzerkennung. +javagui.wizard.schritt4.label1=Für die optimale Performance benötigt appleJuice noch ein paar kleine Informationen über deine Internetverbindung. +javagui.wizard.schritt4.label2=Wäle die Art deiner Internetverbindung\: +javagui.wizard.schritt5.label1=Das wars\! appleJuice ist konfiguriert, um auf deinem Computer zu arbeiten. Solltest du die Einstellungen wieder ändern wollen, kannst du den Wizard über das Optionenmenü erneut starten. +javagui.wizard.schritt5.label2=Viel Spaß mit appleJuice\! ;-) javagui.wizard.titel=Willkommen bei appleJuice javagui.wizard.weiter=Weiter -javagui.wizard.zurueck=Zur\u00FCck +javagui.wizard.zurueck=Zurück Languageinfo.by=TuxHomer Languageinfo.name=Deutsch Languageinfo.version=2.3(040129) linklist.caption=Dateiliste linklist.files.col0caption=Dateiname -linklist.files.col1caption=Gr\u00F6\u00DFe -linklist.Label1.caption=Zieh die Dateien einfach in die Liste, die du hinzuf\u00FCgen willst -mainform.aboutbtn.caption=\u00DCber -mainform.aboutbtn.hint=Infos \u00FCber appleJuice. -mainform.addosubdirsbtn.caption=Ordner ohne Unterverzeichnisse hinzuf\u00FCgen -mainform.addosubdirsbtn.hint=Ordner, ohne die im Ordner enthaltenen Unterverzeichnisse hinzuf\u00FCgen. -mainform.addserv.caption=Server hinzuf\u00FCgen -mainform.addwsubdirsbtn.caption=Ordner mit Unterverzeichnissen hinzuf\u00FCgen -mainform.addwsubdirsbtn.hint=Ordner, mit den im Ordner enthaltenen Unterverzeichnissen hinzuf\u00FCgen. +linklist.files.col1caption=Größe +linklist.Label1.caption=Zieh die Dateien einfach in die Liste, die du hinzufügen willst +mainform.aboutbtn.caption=Über +mainform.aboutbtn.hint=Infos über appleJuice. +mainform.addosubdirsbtn.caption=Ordner ohne Unterverzeichnisse hinzufügen +mainform.addosubdirsbtn.hint=Ordner, ohne die im Ordner enthaltenen Unterverzeichnisse hinzufügen. +mainform.addserv.caption=Server hinzufügen +mainform.addwsubdirsbtn.caption=Ordner mit Unterverzeichnissen hinzufügen +mainform.addwsubdirsbtn.hint=Ordner, mit den im Ordner enthaltenen Unterverzeichnissen hinzufügen. mainform.browse.caption=Browsen mainform.browse1.caption=Browsen mainform.browsebtn.caption=Browsen @@ -244,45 +240,45 @@ mainform.browsetree.browsestat2=Lade Liste mainform.browsetree.browsestat3=Fertig mainform.browsetree.browsestat4=Abgeblockt mainform.browsetree.col0caption=Name -mainform.browsetree.col1caption=Gr\u00F6\u00DFe/Status +mainform.browsetree.col1caption=Größe/Status mainform.canceldown.caption=Abbrechen mainform.cancelsearch.caption=Suche stoppen -mainform.caption=appleJuice Client -mainform.changetarget.caption=Zielordner \u00E4ndern +mainform.caption=appleJuice GUI +mainform.changetarget.caption=Zielordner ändern mainform.chat1.caption=Chat mainform.chat2.caption=Chat mainform.chatbutton.caption=Chat -mainform.chatbutton.hint=Chat ein/aus schalten. Wenn eingedr\u00FCckt Chat an. +mainform.chatbutton.hint=Chat ein/aus schalten. Wenn eingedrückt Chat an. mainform.chatsheet.caption=Chat -mainform.checkserver.caption=\u00DCberpr\u00FCfen -mainform.checkupdate.caption=Update pr\u00FCfen -mainform.checkupdate.hint=Pr\u00FCft, ob eine neuere Version verf\u00FCgbar ist. -mainform.Clearfinishedentries1.caption=Fertige \u00DCbertragungen entfernen -mainform.clearprio.caption=Priorit\u00E4t l\u00F6schen -mainform.clearprio.hint=Die Uploadpriorit\u00E4t f\u00FCr eine Datei l\u00F6schen. -mainform.close1.caption=GUI schlie\u00DFen -mainform.closechatbtn.caption=Schlie\u00DFen -mainform.closeGUIandcore1.caption=GUI und Core schlie\u00DFen +mainform.checkserver.caption=Überprüfen +mainform.checkupdate.caption=Update prüfen +mainform.checkupdate.hint=Prüft, ob eine neuere Version verfügbar ist. +mainform.Clearfinishedentries1.caption=Fertige Übertragungen entfernen +mainform.clearprio.caption=Priorität löschen +mainform.clearprio.hint=Die Uploadpriorität für eine Datei löschen. +mainform.close1.caption=GUI schließen +mainform.closechatbtn.caption=Schließen +mainform.closeGUIandcore1.caption=GUI und Core schließen mainform.conbtn.connectedcaption=Verbinden mainform.conbtn.disconnectedcaption=Trennen mainform.connserv.caption=Verbinden mainform.deldirbtn.caption=Ordner entfernen mainform.deldirbtn.hint=Einen Ordner aus der Share-Liste entfernen. -mainform.delserv.caption=L\u00F6schen +mainform.delserv.caption=Löschen mainform.dirarr.caption=Fenster vertikal anordnen mainform.dirarr.hint=Das Fenster anders unterteilen. mainform.dirssheet.caption=Verzeichnisse mainform.doratio.caption=Erzwinge Ratio -mainform.doratio.hint=Erzwinge ein 1\:1 Verh\u00E4ltniss. Powerdownload ist nicht aktiv\! Wenn eingedr\u00FCckt Ratio aktiv. +mainform.doratio.hint=Erzwinge ein 1\:1 Verhältniss. Powerdownload ist nicht aktiv\! Wenn eingedrückt Ratio aktiv. mainform.downl.caption=Download mainform.downlajfsp.caption=Download mainform.downlajfsp.hint=Die Datei aus dem Link downloaden. mainform.Download1.caption=Downloaden mainform.filessheet.caption=Dateien -mainform.firewallwarning.caption=Es ist m\u00F6glich, das du hinter einer Firewall, einem Router, Proxy oder \u00E4hnlichem sitzt. Dies vermindert die Chance was zu laden. +mainform.firewallwarning.caption=Es ist möglich, das du hinter einer Firewall, einem Router, Proxy oder änlichem sitzt. Dies vermindert die Chance was zu laden. mainform.getlink1.caption=Link in Ablage kopieren mainform.getlink2.caption=Link in Ablage kopieren -mainform.Getlink3.caption=Link \u00FCbernehmen +mainform.Getlink3.caption=Link übernehmen mainform.homesheet.caption=Start mainform.html10=Du bist mit %s verbunden. Das ist einer von %d bekannten Servern. mainform.html11=Kein Server @@ -290,8 +286,8 @@ mainform.html12=Unbekannter Server mainform.html13=Netzwerk, Neuigkeiten und Nachrichten mainform.html14=%sAktualisiere%s die Neuigkeiten und Nachrichten mainform.html15=Warnungen -mainform.html16=Es sieht so aus, als h\u00E4ttest du kein Password f\u00FCr den Core vergeben. Es ist sehr zu empfehlen dies in den %sOptionen%s zu \u00E4ndern. -mainform.html17=Gefundene Version im %sInternet%s\: %s (%sNochmal \u00FCberpr\u00FCfen%s) +mainform.html16=Es sieht so aus, als hättest du kein Password für den Core vergeben. Es ist sehr zu empfehlen dies in den %sOptionen%s zu ändern. +mainform.html17=Gefundene Version im %sInternet%s\: %s (%sNochmal überprüfen%s) mainform.html18=Dein Netzwerkstatus\: %s mainform.html19=Keine Info mainform.html1=Dein Client @@ -303,28 +299,28 @@ mainform.html6=Mein Share mainform.html7=appleJuice Netzwerk mainform.html8=Scanne Shares. mainform.html9=Du %shast%s %s Datei(en) im Share, insgesamt %s. -mainform.Label1.caption=\ \u00FCberpr\u00FCft +mainform.Label1.caption=\ überprüft mainform.Label10.caption=1 mainform.Label11.caption=Mehr Server gibt es hier mainform.Label12.caption=\: mainform.Label13.caption=Browse bei anderen User - IP \: -mainform.Label14.caption=ajfsp-Link hinzuf\u00FCgen -mainform.Label2.caption=\ geladen -mainform.Label3.caption=\ nicht verf\u00FCgbar -mainform.Label4.caption=\ verf\u00FCgbar -mainform.Label6.caption=Wieviel willst du maximal f\u00FCr 1 Byte bezahlen? -mainform.Label7.caption=F\u00FCr 1 Byte zahle +mainform.Label14.caption=ajfsp-Link hinzufügen +mainform.Label2.caption=\ geladen +mainform.Label3.caption=\ nicht verfügbar +mainform.Label4.caption=\ verfügbar +mainform.Label6.caption=Wieviel willst du maximal für 1 Byte bezahlen? +mainform.Label7.caption=Für 1 Byte zahle mainform.Label8.caption=Credits -mainform.Label9.caption=Die aktuelle Priorit\u00E4t betr\u00E4gt -mainform.msgdlgtext10=Kann nicht einloggen\: Der Ordner f\u00FCr die fertigen Datei(en) ist nicht vorhanden. -mainform.msgdlgtext11=Kann nicht einloggen\: Bitte \u00E4ndere deinen Benutzernamen. +mainform.Label9.caption=Die aktuelle Priorität beträgt +mainform.msgdlgtext10=Kann nicht einloggen\: Der Ordner für die fertigen Datei(en) ist nicht vorhanden. +mainform.msgdlgtext11=Kann nicht einloggen\: Bitte ändere deinen Benutzernamen. mainform.msgdlgtext12=Gestoppt. -mainform.msgdlgtext13=\u00DCberpr\u00FCfe Ordner %s +mainform.msgdlgtext13=Überprüfe Ordner %s mainform.msgdlgtext14=Hashe Datei %s mainform.msgdlgtext15=Fertig - %s Datei(en) im Share (%s) -mainform.msgdlgtext1=Dr\u00FCcke "Suchen" zum suchen. -mainform.msgdlgtext2=Eine neue Version wurde gefunden. Homepage jetzt \u00F6ffnen? -mainform.msgdlgtext3=Falsches Pa\u00DFwort. +mainform.msgdlgtext1=Drücke "Suchen" zum suchen. +mainform.msgdlgtext2=Eine neue Version wurde gefunden. Homepage jetzt öffnen? +mainform.msgdlgtext3=Falsches Paßwort. mainform.msgdlgtext4=Fehler beim Verbinden zu %s\:%d mainform.msgdlgtext5=Den Download der Dateien wirklich abbrechen? mainform.msgdlgtext6=Den Download der Datei(en) wirklich pausieren? @@ -345,7 +341,7 @@ mainform.powerdownload.caption=Powerdownload mainform.powerinactive.caption=Powerdownload inaktiv mainform.queue.col0caption=Dateiname mainform.queue.col1caption=Status -mainform.queue.col2caption=Gr\u00F6\u00DFe +mainform.queue.col2caption=Größe mainform.queue.col3caption=Bereits geladen mainform.queue.col4caption=Geschwindigkeit mainform.queue.col5caption=Restliche Zeit @@ -360,7 +356,7 @@ mainform.queue.queuestat17=Abgebrochen mainform.queue.queuestat18=Pause mainform.queue.queuestat1=Nicht genug Platz auf der Festplatte mainform.queue.queuestatlook=Suche -mainform.queue.queuestattransfer=\u00DCbertrage +mainform.queue.queuestattransfer=Übertrage mainform.queue.userstat10=Versuche indirekt zu verbinden mainform.queue.userstat11=Verbindung fehlgeschlagen mainform.queue.userstat12=Nicht genug Credits @@ -368,16 +364,16 @@ mainform.queue.userstat13=Pause mainform.queue.userstat1=Ungefragt mainform.queue.userstat2=Versuche zu verbinden mainform.queue.userstat3=Andere Seite hat eine alte Version -mainform.queue.userstat4=Client kann die Datei nicht \u00F6ffnen +mainform.queue.userstat4=Client kann die Datei nicht öffnen mainform.queue.userstat51=Position %d mainform.queue.userstat5=Warteschlange mainform.queue.userstat6=Keine brauchbaren Teile -mainform.queue.userstat7=\u00DCbertrage +mainform.queue.userstat7=Übertrage mainform.queue.userstat8=Nicht genug platz auf der Festplatte mainform.queue.userstat9=Fertig mainform.queuesheet.caption=Download mainform.reluser.caption=User aktualisieren -mainform.remuser.caption=User l\u00F6schen +mainform.remuser.caption=User löschen mainform.renamefile.caption=Umbenennen mainform.resumedown.caption=Fortsetzen mainform.seachsheet.caption=Suchen @@ -385,9 +381,9 @@ mainform.searchbtn.searchcaption=Suche mainform.searchbtn.searchnextcaption=Weiter suchen mainform.searchlbl.caption=Suchen mainform.searchs.col0caption=Dateiname -mainform.searchs.col1caption=Gr\u00F6\u00DFe +mainform.searchs.col1caption=Größe mainform.searchs.col2caption=Anzahl -mainform.searchs.col3caption=K\u00FCnstler +mainform.searchs.col3caption=Künstler mainform.searchs.col4caption=Titel mainform.searchs.col5caption=Bitrate mainform.searchs.searchstat1=Bereits geladen oder schon am laden @@ -402,20 +398,20 @@ mainform.serverlist.col6caption=Benutzer mainform.serverlist.col7caption=Dateien mainform.serverlist.col8caption=Dateivolumen mainform.serversheet.caption=Server -mainform.setprio.caption=Setze Priorit\u00E4t -mainform.setprio.hint=Die Priorit\u00E4t f\u00FCr den Upload einer Datei einstellen. +mainform.setprio.caption=Setze Priorität +mainform.setprio.hint=Die Priorität für den Upload einer Datei einstellen. mainform.setpwdlbtn.caption=Setze Powerdownload mainform.sfiles.col0caption=Name -mainform.sfiles.col1caption=Gr\u00F6\u00DFe -mainform.sfiles.col2caption=Priorit\u00E4t +mainform.sfiles.col1caption=Größe +mainform.sfiles.col2caption=Priorität mainform.sharereload.caption=Shareanzeige erneuern mainform.sharereload.hint=Die Anzeige der gesharten Dateien neu aufbauen. mainform.sharesheet.caption=Mein Share mainform.show1.caption=Zeigen mainform.showconsolebtn.caption=Zeige/Verstecke Core -mainform.showconsolebtn.hint=Zeige/Verstecke das Konsolenfenster. Wenn eingedr\u00FCckt Core sichtbar(Ist das Dos Fenster). -mainform.startsharecheck.caption=Share\u00FCberpr\u00FCfung starten -mainform.startsharecheck.hint=Gesharte Ordner \u00FCberpr\u00FCfen und gegebenenfalls neue Dateien hashen. +mainform.showconsolebtn.hint=Zeige/Verstecke das Konsolenfenster. Wenn eingedrückt Core sichtbar(Ist das Dos Fenster). +mainform.startsharecheck.caption=Shareüberprüfung starten +mainform.startsharecheck.hint=Gesharte Ordner überprüfen und gegebenenfalls neue Dateien hashen. mainform.status.simpletextconnected=Verbunden mit %s. mainform.status.status0=%d offene Verbindungen mainform.status.status1notconnected=Nicht verbunden @@ -426,21 +422,21 @@ mainform.uploads.col0caption=Dateiname mainform.uploads.col1caption=Nickname mainform.uploads.col2caption=Geschwindigkeit mainform.uploads.col3caption=Status -mainform.uploads.col4caption=Priorit\u00E4t +mainform.uploads.col4caption=Priorität mainform.uploads.col5caption=Core mainform.uploads.colletzteverbindung=letzte Verbindung mainform.uploads.indirekteverbindung=indirekt verbunden mainform.uploads.direkteverbindung=verbunden mainform.uploads.verbindungunbekannt=Verbindung unbekannt mainform.uploads.verbn=verbunden -mainform.uploads.uplstat1=\u00DCbertrage +mainform.uploads.uplstat1=Übertrage mainform.uploads.uplstat2=von mainform.uploads.uplstat3=Warteschlange mainform.uploads.uplstat4=Warteschlange - nicht genug Credits mainform.uploads.uplstat5= mainform.uploads.uplstat6=Versuche zu verbinden mainform.uploads.uplstat7=Versuche indirekt zu verbinden -mainform.uploads.uplstat8=Verbindung nicht m\u00F6glich +mainform.uploads.uplstat8=Verbindung nicht möglich mainform.uploadsheet.caption=Upload newversionform.Button1.caption=Download newversionform.Button2.caption=Abbrechen @@ -449,7 +445,7 @@ newversionform.Label1.caption=Eine neue Version wurde gefunden. Willst du die je newversionform.Label2.caption=Deine Version newversionform.Label3.caption=Neue Version newversionform.Label4.caption=Typ -newversionform.Label5.caption=Zeige mir Versionskonflickte nur f\u00FCr +newversionform.Label5.caption=Zeige mir Versionskonflickte nur für newversionform.newver.caption=Neue Ver. newversionform.verbox1=all Versions / alpha newversionform.verbox2=finals and betas @@ -460,8 +456,8 @@ newversionform.yourver.caption=Deine Ver. pwrdownform.Button1.caption=OK pwrdownform.Button2.caption=Abbruch pwrdownform.caption=Powerdownload -pwrdownform.Label1.caption=Wieviel willst du maximal f\u00FCr ein Byte bezahlen? -pwrdownform.Label2.caption=F\u00FCr 1 Byte zahle +pwrdownform.Label1.caption=Wieviel willst du maximal für ein Byte bezahlen? +pwrdownform.Label2.caption=Für 1 Byte zahle pwrdownform.Label3.caption=Credits pwrdownform.poweractive.caption=Powerdownload aktiv pwrdownform.powerinactive.caption=Powerdownload inaktiv @@ -478,26 +474,6 @@ speedpopup.mindownload.caption=0,00 kb speedpopup.minupload.caption=0,00 kb targetdirform.Button1.caption=OK targetdirform.Button2.caption=Abbruch -targetdirform.caption=Zielordner \u00E4ndern -targetdirform.Label1.caption=Gebe ein Unterverzeichnis f\u00FCr die fertigen Dateien an. Der Ordner mu\u00DF nicht vorhanden sein. Nix eingeben bedeutet, das du die Datei direkt im Fertigen Datei Ordner speicherst. - -releaseinfo.menu=Release-Info -releaseinfo.categories=Kategorien: -releaseinfo.format=Format: -releaseinfo.viewed=Aufgerufen: -releaseinfo.count=%all (aktueller Monat: %month) -releaseinfo.clicks=Klicks: -releaseinfo.published=Verffentlicht: -releaseinfo.today=Heute -releaseinfo.yesterday=Gestern -releaseinfo.languages=Sprachen: -releaseinfo.genres=Genres: -releaseinfo.rating.video=Bild-Bewertung: -releaseinfo.rating.audio=Ton-Bewertung: -releaseinfo.fsk18=FSK 18: -releaseinfo.yes=ja -releaseinfo.no=nein -releaseinfo.downloadimage=Bild herunterladen -releaseinfo.downloadimage.ok=Das Bild wurde erfolgreich heruntergeladen. -releaseinfo.na=Keine Release-Info fr diese Datei verfgbar. -releaseinfo.browse=Infoseite aufrufen \ No newline at end of file +targetdirform.caption=Zielordner ändern +targetdirform.Label1.caption=Gebe ein Unterverzeichnis für die fertigen Dateien an. Der Ordner muß nicht vorhanden sein. Nix eingeben bedeutet, das du die Datei direkt im Fertigen Datei Ordner speicherst. +releaseinfo.menu=Suche nach mehr Informationen diff --git a/AJClientGUI/language/english.gif b/resources/language/english.gif similarity index 100% rename from AJClientGUI/language/english.gif rename to resources/language/english.gif diff --git a/AJClientGUI/language/english.properties b/resources/language/english.properties similarity index 96% rename from AJClientGUI/language/english.properties rename to resources/language/english.properties index 96f3f056..85bc8bdf 100644 --- a/AJClientGUI/language/english.properties +++ b/resources/language/english.properties @@ -89,7 +89,7 @@ javagui.downloadform.bereitsgeladen='%s' already loaded. javagui.downloadform.datawirderstellt=creating .data javagui.downloadform.dreckigerrest=the fucking rest javagui.downloadform.eigeneslimiterreicht=limit reached -javagui.downloadform.einfuegen=paste +javagui.downloadform.einfuege=paste javagui.downloadform.falscherlink='%s' is invalid. javagui.downloadform.fehlerbeimfertigstellen=error while completing javagui.downloadform.getlinkwithsources=Copy link with source to clipboard @@ -199,12 +199,11 @@ javagui.startup.fehlversuch=Unable to connect to core javagui.startup.newversionnachricht=A new version was found (%s). Please do not use old versions. javagui.startup.newversiontitel=Found new version javagui.startup.showdialog=never show again -javagui.startup.sonstigeversionen=Other versions javagui.startup.trayfehler=TrayIcon12.dll not found. Application starts without TrayIcon. javagui.startup.ueberpruefeEinst=Please check your settings\: javagui.startup.updatefehlernachricht=You have to specify a correct webbrowser to use this feature. javagui.startup.verbindungsfehler=It was not possible to connect to the remote-core on '%s'. AppleJuice will close. -javagui.startup.windowsversion=Windowsversion +javagui.startup.newversion=Download javagui.tooltipps.autopowerdownload=By activation of the automatic power download you can fix, from which count of|credits the power download is activated and when it switches|off itself again. The power download always considers the mostly loaded files.|The GUI must run. javagui.tooltipps.powerdownload=Activation of powerdownload increases your chances to download.|The more credits you spend, the higher you slip in the queue. javagui.uploadform.columnwasserstand=watermark @@ -253,7 +252,7 @@ mainform.browsetree.col0caption=Name mainform.browsetree.col1caption=Size/Status mainform.canceldown.caption=Cancel mainform.cancelsearch.caption=Cancel Search -mainform.caption=appleJuice Client +mainform.caption=appleJuice GUI mainform.changetarget.caption=Change targetdir mainform.chat1.caption=Chat mainform.chat2.caption=chat @@ -492,23 +491,4 @@ targetdirform.Button2.caption=Cancel targetdirform.caption=change Targetdirectory targetdirform.Label1.caption=Please Enter a Subdirectory of your Incoming. This directory does not have to exist. Empty directory mean you want to save the file directly in the incoming directory. targetdirform=\n\t -releaseinfo.menu=Release-information -releaseinfo.categories=Categories: -releaseinfo.format=Format: -releaseinfo.viewed=Viewed: -releaseinfo.count=%all (current month: %month) -releaseinfo.clicks=Clicks: -releaseinfo.published=Published: -releaseinfo.today=Today -releaseinfo.yesterday=Yesterday -releaseinfo.languages=Languages: -releaseinfo.genres=Genres: -releaseinfo.rating.video=Video-Rating: -releaseinfo.rating.audio=Audio-Rating: -releaseinfo.fsk18=FSK 18: -releaseinfo.yes=yes -releaseinfo.no=no -releaseinfo.downloadimage=Download picture -releaseinfo.downloadimage.ok=Picture successfully downloaded. -releaseinfo.na=No release-information available. -releaseinfo.browse=Browse site \ No newline at end of file +releaseinfo.menu=search for more information diff --git a/AJClientGUI/language/italiano.gif b/resources/language/italiano.gif similarity index 100% rename from AJClientGUI/language/italiano.gif rename to resources/language/italiano.gif diff --git a/AJClientGUI/language/italiano.properties b/resources/language/italiano.properties similarity index 99% rename from AJClientGUI/language/italiano.properties rename to resources/language/italiano.properties index 64242dc9..f57cb8ad 100644 --- a/AJClientGUI/language/italiano.properties +++ b/resources/language/italiano.properties @@ -179,12 +179,11 @@ javagui.startup.fehlversuch=Connessione del Core non eseguito. javagui.startup.newversionnachricht=Una nuova Versione di Applejuice \u00E8 stata trovata (%s). Sie prega di non utlizzare versiopne vecchie javagui.startup.newversiontitel=Nova versione trovata javagui.startup.showdialog=non visualizzare mai piu -javagui.startup.sonstigeversionen=Altri javagui.startup.trayfehler=TrayIcon12.dll non fu trovato. Il programma si apre senza TrayIcon. javagui.startup.ueberpruefeEinst=Sie prega di controllare le impostazioni javagui.startup.updatefehlernachricht=Devi selezionare un browser per le pagine web che funzioni, per utilizzare questa funzione javagui.startup.verbindungsfehler=Non cera la possibilit\u00E0 di connetermi sul Core su '%s'. AppleJuice viene chiuso. -javagui.startup.windowsversion=Versione Windows +javagui.startup.newversion=Download javagui.tooltipps.autopowerdownload=Con l'attivazione del Powerdownload automatico puoi decidere quando il|Powerdownload inizia, e quando deve smettere.|Il Powerdownload sa sempre qui file che sono caricati tante volte.|Il GUI deve correre. javagui.tooltipps.powerdownload=Con l'attivazione del Powerdownload sale la possibilita di scaricare qualcosa.|Se paghi di piu Crediti, sali nella lista d'attesa del Cliente che ha il file che vuoi. javagui.uploadform.columnwasserstand=watermark @@ -232,7 +231,7 @@ mainform.browsetree.col0caption=Nome mainform.browsetree.col1caption=Grandezza/Status mainform.canceldown.caption=Annulla mainform.cancelsearch.caption=Annulla la cerca -mainform.caption=Cliente appleJuice +mainform.caption=appleJuice GUI mainform.changetarget.caption=cambia cartella mainform.chat1.caption=Chat mainform.chat2.caption=Chat diff --git a/AJClientGUI/language/tuerkce.gif b/resources/language/tuerkce.gif similarity index 100% rename from AJClientGUI/language/tuerkce.gif rename to resources/language/tuerkce.gif diff --git a/AJClientGUI/language/tuerkce.properties b/resources/language/tuerkce.properties similarity index 99% rename from AJClientGUI/language/tuerkce.properties rename to resources/language/tuerkce.properties index 14e48536..6b88dcc1 100644 --- a/AJClientGUI/language/tuerkce.properties +++ b/resources/language/tuerkce.properties @@ -192,12 +192,11 @@ javagui.startup.fehlversuch=Core ba\u011Flant\u0131s\u0131 yap\u0131lamad\u0131 javagui.startup.newversionnachricht=Yeni bir Applejuice bulundu (%s). L\u00FCtfen eski Version kullanmay\u0131n\u0131z. javagui.startup.newversiontitel=Yeni versiyon bulundu...... javagui.startup.showdialog=Hi\u00E7 bir daha g\u00F6sterme -javagui.startup.sonstigeversionen=Diyerleri javagui.startup.trayfehler=TrayIcon12.dll bulundu. Programm TrayIconsus \u00E7al\u0131\u015Facak. javagui.startup.ueberpruefeEinst=L\u00FCtfen vermi\u015F oldu\u011Fun de\u011Ferleri kontrol et\: javagui.startup.updatefehlernachricht=Bu funksiyonu kullanabilmen i\u00E7in. G\u00FCncel bir Webbrowser se\u00E7mek zorundas\u0131n\u0131z. Kulland\u0131\u011F\u0131n\u0131z BROWSER\u00B4\u0130 Ekstralar / Se\u00E7enekler \u00FCzerinden belleyebilirsiniz. javagui.startup.verbindungsfehler=Uzaktaki Cora ba\u011Flant\u0131 kurmak m\u00FCmk\u00FCn '%s' de\u011Fildi. AppleJuice kapat\u0131l\u0131yor. -javagui.startup.windowsversion=Windows versiyonu +javagui.startup.newversion=Download javagui.tooltipps.autopowerdownload=Otomatik Powerdownloadta, powerdownloadun download ba\u015F\u0131na |ne kadar kredi vermesini sabitle\u015Ftirmi\u015F ve ne zaman ac\u0131l\u0131p /|kapanaca\u011F\u0131n\u0131 belirlemi\u015F olursunuz. Powerdownload en \u00E7ok |indirilmi\u015F(mb) olan Dosyalara \u00F6ncelik sa\u011Flar. javagui.tooltipps.powerdownload=Powerdownloadu aktifle\u015Ftirirseniz indirme \u015Fans\u0131n\u0131z| y\u00FCkselecektir, ve ne kadar \u00E7ok kredi verirseniz, |bekleme kuyru\u011Funda o kadar yukar\u0131ya \u00E7\u0131kacaks\u0131n\u0131z. javagui.uploadform.columnwasserstand=watermark @@ -248,7 +247,7 @@ mainform.browsetree.col0caption=\u0130sim mainform.browsetree.col1caption=Miktar / Durum mainform.canceldown.caption=\u0130ptal/\u0130ndirmeyece\u011Fim mainform.cancelsearch.caption=Aramay\u0131 durdur -mainform.caption=AppleJuice klienti +mainform.caption=appleJuice GUI mainform.changetarget.caption=Arzu etti\u011Fin dosyay\u0131 de\u011Fi\u015Ftir mainform.chat1.caption=Chat mainform.chat2.caption=Chat diff --git a/ajcorefassade/.cvsignore b/resources/needed_jars/.gitignore similarity index 100% rename from ajcorefassade/.cvsignore rename to resources/needed_jars/.gitignore diff --git a/AJClientGUI/plugins/.cvsignore b/resources/plugins/.gitignore similarity index 100% rename from AJClientGUI/plugins/.cvsignore rename to resources/plugins/.gitignore diff --git a/resources/plugins/readme.txt b/resources/plugins/readme.txt new file mode 100644 index 00000000..f9e5f0a4 --- /dev/null +++ b/resources/plugins/readme.txt @@ -0,0 +1,3 @@ +In dieses Verzeichnis kommen die Plugins als jar-Archive rein. +Falls Du Linux oder macOS verwendest, wird dieses Verzeichnis nicht beachtet. +Dann gehören Plugins ins Verzeichnis ~/appleJuice/gui/plugins/ diff --git a/AJClientGUI/pwdlpolicies/.cvsignore b/resources/pwdlpolicies/.gitignore similarity index 100% rename from AJClientGUI/pwdlpolicies/.cvsignore rename to resources/pwdlpolicies/.gitignore diff --git a/AJClientGUI/pwdlpolicies/readme.txt b/resources/pwdlpolicies/readme.txt similarity index 100% rename from AJClientGUI/pwdlpolicies/readme.txt rename to resources/pwdlpolicies/readme.txt diff --git a/AJClientGUI/sounds/abgebrochen.wav b/resources/sounds/abgebrochen.wav similarity index 100% rename from AJClientGUI/sounds/abgebrochen.wav rename to resources/sounds/abgebrochen.wav diff --git a/AJClientGUI/sounds/gespeichert.wav b/resources/sounds/gespeichert.wav similarity index 100% rename from AJClientGUI/sounds/gespeichert.wav rename to resources/sounds/gespeichert.wav diff --git a/AJClientGUI/sounds/gestartet.wav b/resources/sounds/gestartet.wav similarity index 100% rename from AJClientGUI/sounds/gestartet.wav rename to resources/sounds/gestartet.wav diff --git a/AJClientGUI/sounds/komplett.wav b/resources/sounds/komplett.wav similarity index 100% rename from AJClientGUI/sounds/komplett.wav rename to resources/sounds/komplett.wav diff --git a/AJClientGUI/sounds/konkretisieren.wav b/resources/sounds/konkretisieren.wav similarity index 100% rename from AJClientGUI/sounds/konkretisieren.wav rename to resources/sounds/konkretisieren.wav diff --git a/AJClientGUI/sounds/laden.wav b/resources/sounds/laden.wav similarity index 100% rename from AJClientGUI/sounds/laden.wav rename to resources/sounds/laden.wav diff --git a/AJClientGUI/sounds/pwdl.wav b/resources/sounds/pwdl.wav similarity index 100% rename from AJClientGUI/sounds/pwdl.wav rename to resources/sounds/pwdl.wav diff --git a/AJClientGUI/sounds/readme.first b/resources/sounds/readme.first similarity index 100% rename from AJClientGUI/sounds/readme.first rename to resources/sounds/readme.first diff --git a/AJClientGUI/sounds/suchen.wav b/resources/sounds/suchen.wav similarity index 100% rename from AJClientGUI/sounds/suchen.wav rename to resources/sounds/suchen.wav diff --git a/AJClientGUI/sounds/verbinden.wav b/resources/sounds/verbinden.wav similarity index 100% rename from AJClientGUI/sounds/verbinden.wav rename to resources/sounds/verbinden.wav diff --git a/AJClientGUI/sounds/verweigert.wav b/resources/sounds/verweigert.wav similarity index 100% rename from AJClientGUI/sounds/verweigert.wav rename to resources/sounds/verweigert.wav diff --git a/AJClientGUI/sounds/zuganggestattet.wav b/resources/sounds/zuganggestattet.wav similarity index 100% rename from AJClientGUI/sounds/zuganggestattet.wav rename to resources/sounds/zuganggestattet.wav diff --git a/AJClientGUI/themes/aquathemepack.zip b/resources/themes/aquathemepack.zip similarity index 100% rename from AJClientGUI/themes/aquathemepack.zip rename to resources/themes/aquathemepack.zip diff --git a/resources/themes/readme.txt b/resources/themes/readme.txt new file mode 100644 index 00000000..eaeafb0a --- /dev/null +++ b/resources/themes/readme.txt @@ -0,0 +1,2 @@ +Weitere Themes gibt ess auf https://github.com/l2fprod/javootoo.com/tree/master/plaf/skinlf/themepacks +Es werden nur zip-Formate unterstützt! diff --git a/AJClientGUI/themes/toxicthemepack.zip b/resources/themes/toxicthemepack.zip similarity index 100% rename from AJClientGUI/themes/toxicthemepack.zip rename to resources/themes/toxicthemepack.zip diff --git a/resources/wizard.xml b/resources/wizard.xml new file mode 100644 index 00000000..f5848d3c --- /dev/null +++ b/resources/wizard.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<root> + <wizard bezeichnung="Wizard"> + <connection bezeichnung="DSL 384" maxupload="128" maxdownload="384" maxnewconnections10="50"/> + <connection bezeichnung="DSL 786" maxupload="128" maxdownload="786" maxnewconnections10="50"/> + <connection bezeichnung="DSL 1.000" maxupload="128" maxdownload="1024" maxnewconnections10="50"/> + <connection bezeichnung="DSL 2.000" maxupload="192" maxdownload="2048" maxnewconnections10="50"/> + <connection bezeichnung="DSL 3.000" maxupload="384" maxdownload="3072" maxnewconnections10="50"/> + <connection bezeichnung="DSL 6.000" maxupload="786" maxdownload="6016" maxnewconnections10="50"/> + <connection bezeichnung="DSL 16.000" maxupload="1024" maxdownload="16384" maxnewconnections10="50"/> + <connection bezeichnung="VDSL 25.000" maxupload="4096" maxdownload="25600" maxnewconnections10="50"/> + <connection bezeichnung="VDSL 50.000" maxupload="9216" maxdownload="51200" maxnewconnections10="50"/> + <connection bezeichnung="VDSL 100.000" maxupload="20480" maxdownload="102400" maxnewconnections10="50"/> + <connection bezeichnung="VDSL 250.000" maxupload="40960" maxdownload="256000" maxnewconnections10="50"/> + <connection bezeichnung="Cable 25" maxupload="1024" maxdownload="25600" maxnewconnections10="50"/> + <connection bezeichnung="Cable 50" maxupload="2048" maxdownload="51200" maxnewconnections10="50"/> + <connection bezeichnung="Cable 100" maxupload="12288" maxdownload="102400" maxnewconnections10="50"/> + <connection bezeichnung="Cable 200" maxupload="25600" maxdownload="204800" maxnewconnections10="50"/> + <connection bezeichnung="Cable 400" maxupload="25600" maxdownload="409600" maxnewconnections10="50"/> + <connection bezeichnung="Cable 500" maxupload="51200" maxdownload="512000" maxnewconnections10="50"/> + <connection bezeichnung="Cable 1.000" maxupload="51200" maxdownload="1024000" maxnewconnections10="50"/> + <connection bezeichnung="Fiber 250" maxupload="10240" maxdownload="25600" maxnewconnections10="50"/> + <connection bezeichnung="Fiber 500" maxupload="25600" maxdownload="512000" maxnewconnections10="50"/> + <connection bezeichnung="Fiber 1.000" maxupload="51200" maxdownload="1024000" maxnewconnections10="50"/> + </wizard> +</root> diff --git a/snap/gui/applejuice-gui.desktop b/snap/gui/applejuice-gui.desktop new file mode 100644 index 00000000..089cc719 --- /dev/null +++ b/snap/gui/applejuice-gui.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=appleJuice GUI +GenericName=appleJuice GUI +Comment=appleJuice GUI (connect to appleJuice Client) +Exec=applejuice-gui.ajgui %u +Icon=${SNAP}/meta/gui/applejuice-gui.png +Terminal=false +Type=Application +Categories=Java;Application;Network; +MimeType=x-scheme-handler/ajfsp; +StartupWMClass=AJCoreGUI diff --git a/snap/gui/applejuice-gui.png b/snap/gui/applejuice-gui.png new file mode 100644 index 00000000..0bf9cf9e Binary files /dev/null and b/snap/gui/applejuice-gui.png differ diff --git a/snap/local/launcher b/snap/local/launcher new file mode 100755 index 00000000..d97e0786 --- /dev/null +++ b/snap/local/launcher @@ -0,0 +1,11 @@ +#!/bin/sh + +cd $SNAP/app/ + +# first start, copy plugins +if [ ! -e ~/appleJuice/gui/plugins ]; then + mkdir -p ~/appleJuice/gui/plugins + cp ./plugins/*.jar ~/appleJuice/gui/plugins/ +fi + +java -jar AJCoreGUI.jar "${@}" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000..0fd53477 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,55 @@ +name: applejuice-gui +title: appleJuice Gui +summary: appleJuice GUI for appleJuice Client +description: appleJuice GUI for appleJuice Client +version: 0.83.3 +icon: snap/gui/applejuice-gui.png +license: GPL-2.0 + +grade: stable +confinement: strict +base: core18 + +layout: + /usr/bin/xprop: + bind-file: $SNAP/usr/bin/xprop + +apps: + ajgui: + command: $SNAP/app/launcher + extensions: + - gnome-3-28 + environment: + JAVA_HOME: $SNAP/usr/lib/jvm/java-8-openjdk-amd64/ + PATH: $JAVA_HOME/jre/bin:$PATH + plugs: + - home + - desktop + - desktop-legacy + - network + - network-bind + - audio-playback + - x11 + +parts: + ajgui: + plugin: dump + source: https://github.com/applejuicenet/gui-java/releases/download/$SNAPCRAFT_PROJECT_VERSION/AJCoreGUI.zip + organize: + '*': app/ + + jre: + plugin: nil + build-packages: + - ca-certificates + - ca-certificates-java + - openjdk-8-jre + stage-packages: + - openjdk-8-jre + - x11-utils + + launcher: + plugin: dump + source: ./snap/local + organize: + '*': app/ diff --git a/AJClientGUI/starterexe/AJCoreGUI.dpr b/starterexe/AJCoreGUI.lpr similarity index 60% rename from AJClientGUI/starterexe/AJCoreGUI.dpr rename to starterexe/AJCoreGUI.lpr index 97c7b216..c4a1cbdf 100644 --- a/AJClientGUI/starterexe/AJCoreGUI.dpr +++ b/starterexe/AJCoreGUI.lpr @@ -1,19 +1,22 @@ -program AJCoreGUI; -uses ShellAPI, SysUtils; - -var verzeichnis, argumente, arg: string; - i: integer; -begin -verzeichnis:=ExtractFilePath(ParamStr(0)); -if fileexists(verzeichnis+'\AJCoreGUI.jar')=true then begin - argumente:='-jar AJCoreGUI.jar'; - i:=1; - while ParamStr(i)<>'' do begin - arg:=ParamStr(i); - if copy(arg,0,8)='ajfsp://' then arg:='-link='+arg; - argumente:=argumente+' "'+arg+'"'; - i:=i+1; - end; - ShellExecute(0, 'open' ,PChar('javaw.exe'), PChar(argumente), PChar(verzeichnis), 1); - end; -end. +program AJCoreGUI; +uses ShellAPI, SysUtils; + +{$R project.rc} + +var verzeichnis, argumente, arg: string; + i: integer; +begin +verzeichnis:=ExtractFilePath(ParamStr(0)); +if fileexists(verzeichnis+'\AJCoreGUI.jar')=true then begin + argumente:='-jar AJCoreGUI.jar'; + i:=1; + + for i := 1 to paramCount() do + begin + argumente:=argumente+' '+paramStr(i); + end; + + ShellExecute(0, 'open' ,PChar('javaw.exe'), PChar(argumente), PChar(verzeichnis), 1); + + end; +end. diff --git a/starterexe/ajgui.ico b/starterexe/ajgui.ico new file mode 100644 index 00000000..d03e2ba0 Binary files /dev/null and b/starterexe/ajgui.ico differ diff --git a/starterexe/project.rc b/starterexe/project.rc new file mode 100644 index 00000000..324b0f11 --- /dev/null +++ b/starterexe/project.rc @@ -0,0 +1 @@ +MAINICON ICON "ajgui.ico"