diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index d855be8..dc0d833 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -bin/ +target/ diff --git a/debugTutorial.sh b/debugTutorial.sh new file mode 100755 index 0000000..7e20b3d --- /dev/null +++ b/debugTutorial.sh @@ -0,0 +1,5 @@ +#! /bin/bash +readonly PORT=${1:-8000} +echo Waiting to debug on port ${PORT} +tutorial-product/target/products/Tutorial/Tutorial.exe -console -vmArgs -Xdebug "-Xrunjdwp:server=y,transport=dt_socket,address=${PORT}" & + diff --git a/startTutorial.sh b/startTutorial.sh new file mode 100755 index 0000000..7162a83 --- /dev/null +++ b/startTutorial.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +tutorial-product/fix-mod.sh +tutorial-product/target/products/Tutorial/Tutorial.exe & + diff --git a/.checkstyle b/tutorial-master/.checkstyle similarity index 100% rename from .checkstyle rename to tutorial-master/.checkstyle diff --git a/.classpath b/tutorial-master/.classpath similarity index 53% rename from .classpath rename to tutorial-master/.classpath index c8351b0..89b273f 100644 --- a/.classpath +++ b/tutorial-master/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/tutorial-master/.project b/tutorial-master/.project new file mode 100644 index 0000000..dc3c9fa --- /dev/null +++ b/tutorial-master/.project @@ -0,0 +1,30 @@ + + + tutorial-master + + + + + + org.eclipse.jdt.core.javabuilder + + + + + net.sf.eclipsecs.core.CheckstyleBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + net.sf.eclipsecs.core.CheckstyleNature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/tutorial-master/.settings/org.eclipse.jdt.core.prefs similarity index 98% rename from .settings/org.eclipse.jdt.core.prefs rename to tutorial-master/.settings/org.eclipse.jdt.core.prefs index a188764..22f4d37 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/tutorial-master/.settings/org.eclipse.jdt.core.prefs @@ -8,16 +8,6 @@ org.eclipse.jdt.core.circularClasspath=error org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve diff --git a/.settings/org.eclipse.jdt.launching.prefs b/tutorial-master/.settings/org.eclipse.jdt.launching.prefs similarity index 100% rename from .settings/org.eclipse.jdt.launching.prefs rename to tutorial-master/.settings/org.eclipse.jdt.launching.prefs diff --git a/.settings/org.eclipse.jdt.ui.prefs b/tutorial-master/.settings/org.eclipse.jdt.ui.prefs similarity index 99% rename from .settings/org.eclipse.jdt.ui.prefs rename to tutorial-master/.settings/org.eclipse.jdt.ui.prefs index aff75e3..9715eba 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/tutorial-master/.settings/org.eclipse.jdt.ui.prefs @@ -1,10 +1,10 @@ -#Sat May 14 16:28:21 CDT 2011 -eclipse.preferences.version=1 -formatter_profile=_Wade -formatter_settings_version=11 -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.text.custom_code_templates= +#Sat May 14 16:28:21 CDT 2011 +eclipse.preferences.version=1 +formatter_profile=_Wade +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tutorial-master/.settings/org.eclipse.m2e.core.prefs b/tutorial-master/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 0000000..f897a7f --- /dev/null +++ b/tutorial-master/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/tutorial-master/pom.xml b/tutorial-master/pom.xml new file mode 100755 index 0000000..57cf8d6 --- /dev/null +++ b/tutorial-master/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + + name.wadewalker.tutorial + tutorial-parent + 1.0.0-SNAPSHOT + ../tutorial-parent + + + tutorial-master + pom + + JOGL Eclipse Tutorial Master + JOGL Eclipse tutorial build aggregator + + + ../tutorial-parent + ../tutorial-plugin + ../tutorial-product + + + diff --git a/tutorial-parent/.classpath b/tutorial-parent/.classpath new file mode 100644 index 0000000..89b273f --- /dev/null +++ b/tutorial-parent/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tutorial-parent/.project b/tutorial-parent/.project new file mode 100644 index 0000000..aa47c4a --- /dev/null +++ b/tutorial-parent/.project @@ -0,0 +1,30 @@ + + + tutorial-parent + + + + + + org.eclipse.jdt.core.javabuilder + + + + + net.sf.eclipsecs.core.CheckstyleBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + net.sf.eclipsecs.core.CheckstyleNature + + diff --git a/tutorial-parent/pom.xml b/tutorial-parent/pom.xml new file mode 100755 index 0000000..76ff56b --- /dev/null +++ b/tutorial-parent/pom.xml @@ -0,0 +1,75 @@ + + 4.0.0 + + name.wadewalker.tutorial + tutorial-parent + pom + 1.0.0-SNAPSHOT + + JOGL Eclipse Tutorial Parent + JOGL Eclipse tutorial parent + + + UTF-8 + 3.1 + 0.23.1 + 2.1.2 + + + + + eclipse-luna + p2 + http://download.eclipse.org/releases/luna + + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + 1.7 + 1.7 + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho.version} + true + + + + org.eclipse.tycho + target-platform-configuration + ${tycho.version} + + p2 + consider + + + + win32 + win32 + x86_64 + + + + + + + + + + + com.jogamp.jogl + jogamp-bundle-all-main + ${jogamp.version} + + + + + diff --git a/tutorial-plugin/.checkstyle b/tutorial-plugin/.checkstyle new file mode 100644 index 0000000..489ff5f --- /dev/null +++ b/tutorial-plugin/.checkstyle @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tutorial-plugin/.classpath b/tutorial-plugin/.classpath new file mode 100644 index 0000000..4fba9e8 --- /dev/null +++ b/tutorial-plugin/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.project b/tutorial-plugin/.project similarity index 79% rename from .project rename to tutorial-plugin/.project index fdefe8d..0ff6678 100644 --- a/.project +++ b/tutorial-plugin/.project @@ -1,34 +1,40 @@ - - - name.wadewalker.tutorial - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - net.sf.eclipsecs.core.CheckstyleBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - net.sf.eclipsecs.core.CheckstyleNature - - + + + tutorial-plugin + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + net.sf.eclipsecs.core.CheckstyleBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + net.sf.eclipsecs.core.CheckstyleNature + + diff --git a/tutorial-plugin/.settings/org.eclipse.jdt.core.prefs b/tutorial-plugin/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..22f4d37 --- /dev/null +++ b/tutorial-plugin/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,372 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter= +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=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_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/tutorial-plugin/.settings/org.eclipse.jdt.launching.prefs b/tutorial-plugin/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..3bb2352 --- /dev/null +++ b/tutorial-plugin/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore diff --git a/tutorial-plugin/.settings/org.eclipse.jdt.ui.prefs b/tutorial-plugin/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..9715eba --- /dev/null +++ b/tutorial-plugin/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,10 @@ +#Sat May 14 16:28:21 CDT 2011 +eclipse.preferences.version=1 +formatter_profile=_Wade +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tutorial-plugin/.settings/org.eclipse.m2e.core.prefs b/tutorial-plugin/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 0000000..f897a7f --- /dev/null +++ b/tutorial-plugin/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/META-INF/MANIFEST.MF b/tutorial-plugin/META-INF/MANIFEST.MF similarity index 79% rename from META-INF/MANIFEST.MF rename to tutorial-plugin/META-INF/MANIFEST.MF index f49ae0f..2bc9de8 100644 --- a/META-INF/MANIFEST.MF +++ b/tutorial-plugin/META-INF/MANIFEST.MF @@ -1,19 +1,19 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Tutorial -Bundle-SymbolicName: name.wadewalker.tutorial;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: name.wadewalker.tutorial.Activator -Bundle-Vendor: Wade Walker -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - com.jogamp.jogl;bundle-version="2.0.0", - org.eclipse.e4.ui.workbench.addons.swt;bundle-version="1.1.0", - org.eclipse.equinox.ds;bundle-version="1.4.200", - org.eclipse.equinox.event;bundle-version="1.3.100", - org.eclipse.equinox.util;bundle-version="1.0.500", - org.eclipse.platform;bundle-version="4.4.0", - org.eclipse.ui.forms;bundle-version="3.6.100", - org.eclipse.ui.intro;bundle-version="3.4.200" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Bundle-ActivationPolicy: lazy +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: JOGL Eclipse Tutorial Plugin +Bundle-SymbolicName: tutorial-plugin;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: name.wadewalker.tutorial.Activator +Bundle-Vendor: Wade Walker +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + jogamp-bundle-all-main, + org.eclipse.e4.ui.workbench.addons.swt;bundle-version="1.1.0", + org.eclipse.equinox.ds;bundle-version="1.4.200", + org.eclipse.equinox.event;bundle-version="1.3.100", + org.eclipse.equinox.util;bundle-version="1.0.500", + org.eclipse.platform;bundle-version="4.4.0", + org.eclipse.ui.forms;bundle-version="3.6.100", + org.eclipse.ui.intro;bundle-version="3.4.200" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy diff --git a/build.properties b/tutorial-plugin/build.properties similarity index 88% rename from build.properties rename to tutorial-plugin/build.properties index 02802a8..94df955 100644 --- a/build.properties +++ b/tutorial-plugin/build.properties @@ -1,8 +1,7 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - splash.bmp +source.. = src/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + splash.bmp jre.compilation.profile=JavaSE-1.7 \ No newline at end of file diff --git a/icons/alt_about.gif b/tutorial-plugin/icons/alt_about.gif similarity index 100% rename from icons/alt_about.gif rename to tutorial-plugin/icons/alt_about.gif diff --git a/icons/alt_launcher.icns b/tutorial-plugin/icons/alt_launcher.icns similarity index 100% rename from icons/alt_launcher.icns rename to tutorial-plugin/icons/alt_launcher.icns diff --git a/icons/alt_launcher.ico b/tutorial-plugin/icons/alt_launcher.ico similarity index 100% rename from icons/alt_launcher.ico rename to tutorial-plugin/icons/alt_launcher.ico diff --git a/icons/alt_launcher.xpm b/tutorial-plugin/icons/alt_launcher.xpm similarity index 97% rename from icons/alt_launcher.xpm rename to tutorial-plugin/icons/alt_launcher.xpm index b0c139e..0ff9033 100644 --- a/icons/alt_launcher.xpm +++ b/tutorial-plugin/icons/alt_launcher.xpm @@ -1,307 +1,307 @@ -/* XPM */ -static char * icon48_xpm[] = { -"48 48 256 2", -" c #4B4B3B3B9090", -". c #0D0D0E0E5454", -"X c #11110E0E5B5B", -"o c #17170F0F6363", -"O c #1D1D13136969", -"+ c #212114146C6C", -"@ c #252514147171", -"# c #282811116C6C", -"$ c #26260D0D6363", -"% c #22220B0B5E5E", -"& c #1C1C0B0B5A5A", -"* c #1C1C0B0B5252", -"= c #1B1B05055353", -"- c #161606064D4D", -"; c #161605054949", -": c #111104044848", -"> c #131304044545", -", c #131305054242", -"< c #141410105E5E", -"1 c #2C2C15157373", -"2 c #2B2B1B1B7575", -"3 c #343416167272", -"4 c #313113136E6E", -"5 c #222209095757", -"6 c #1B1B06064D4D", -"7 c #15150B0B4242", -"8 c #13130C0C5555", -"9 c #2E2E1B1B7878", -"0 c #33331F1F7C7C", -"q c #343418187878", -"w c #3B3B1C1C7575", -"e c #2E2E10106767", -"r c #1B1B07074747", -"t c #18180B0B4646", -"y c #151513136262", -"u c #1A1A15156464", -"i c #34341F1F7777", -"p c #40401E1E8080", -"a c #42421B1B7A7A", -"s c #3B3B15157474", -"d c #2B2B0B0B5B5B", -"f c #222207075252", -"g c #373727277A7A", -"h c #474724248484", -"j c #393915156E6E", -"k c #373711116A6A", -"l c #343413136363", -"z c #232319196E6E", -"x c #292919197070", -"c c #3C3C2C2C8282", -"v c #444431318585", -"b c #494934348A8A", -"n c #505026268A8A", -"m c #3D3D1B1B6E6E", -"M c #31310E0E5C5C", -"N c #2B2B0D0D5353", -"B c #222207074A4A", -"V c #52523C3C9292", -"C c #58583C3C9494", -"Z c #5D5D44449797", -"A c #5C5C2E2E9292", -"S c #676733339595", -"D c #424228287575", -"F c #29290A0A4F4F", -"G c #6C6C4A4A9E9E", -"H c #72725454A7A7", -"J c #8C8C6D6DB2B2", -"K c #343424246E6E", -"L c #3A3A23236A6A", -"P c #3A3A1C1C6767", -"I c #24240A0A4B4B", -"U c #151518186161", -"Y c #76766F6FA5A5", -"T c #ADAD9191CCCC", -"R c #98988989D3D3", -"E c #45453B3B8686", -"W c #3C3C35357979", -"Q c #363631317575", -"! c #32322D2D6B6B", -"~ c #323229296363", -"^ c #30301F1F6262", -"/ c #323218185E5E", -"( c #272707074B4B", -") c #202028286C6C", -"_ c #1E1E1D1D6868", -"` c #9A9A8282BBBB", -"' c #C8C8B3B3D3D3", -"] c #B3B3AFAFE7E7", -"[ c #84847272C6C6", -"{ c #58585757A3A3", -"} c #3F3F3C3C8A8A", -"| c #3B3B3A3A8484", -" . c #414139397D7D", -".. c #3D3D39397A7A", -"X. c #37372E2E6E6E", -"o. c #2C2C21215A5A", -"O. c #2E2E1B1B5B5B", -"+. c #F5F5EFEFF5F5", -"@. c #656566669A9A", -"#. c #47474B4B8E8E", -"$. c #3C3C44447B7B", -"%. c #444442428080", -"&. c #45453E3E8181", -"*. c #40403C3C8181", -"=. c #3D3D33337474", -"-. c #3B3B30306E6E", -";. c #38382D2D6969", -":. c #303026265D5D", -">. c #2C2C15155A5A", -",. c #1F1F1C1C7070", -"<. c #25251E1E7171", -"1. c #59595C5C9191", -"2. c #4D4D53538989", -"3. c #4C4C49498484", -"4. c #484845458585", -"5. c #494941418585", -"6. c #494940408181", -"7. c #2F2F1C1C5353", -"8. c #2B2B28287676", -"9. c #323231317F7F", -"0. c #545452528B8B", -"q. c #51514E4E8989", -"w. c #4E4E4B4B8C8C", -"e. c #4C4C47478686", -"r. c #46463D3D7E7E", -"t. c #434336367A7A", -"y. c #2B2B13135555", -"u. c #47473D3D8D8D", -"i. c #575757578E8E", -"p. c #48483E3E7F7F", -"a. c #46463A3A7D7D", -"s. c #424235357575", -"d. c #404034347171", -"f. c #BFBFCBCBFAFA", -"g. c #B8B8A8A8DDDD", -"h. c #5E5E60609292", -"j. c #565655558C8C", -"k. c #4B4B44448282", -"l. c #454539397B7B", -"z. c #434338387878", -"x. c #3F3F32326D6D", -"c. c #3D3D30306969", -"v. c #3A3A2E2E6363", -"b. c #36362A2A5C5C", -"n. c #343424245555", -"m. c #30301E1E4D4D", -"M. c #49493C3C8282", -"N. c #5E5E4F4F8C8C", -"B. c #56563B3B8B8B", -"V. c #545407078585", -"C. c #424234347272", -"Z. c #9797A4A4F7F7", -"A. c #444436367676", -"S. c #7D7D7979D5D5", -"D. c #464640408A8A", -"F. c #44444B4B8282", -"G. c #414107077777", -"H. c #71716161C1C1", -"J. c #303039397979", -"K. c #8E8E8E8EE6E6", -"L. c #404033338B8B", -"P. c #4A4A45458C8C", -"I. c #46463A3A8080", -"U. c #363629295454", -"Y. c #303022224848", -"T. c #424237377575", -"R. c #2E2E1D1D6363", -"E. c #79798383EAEA", -"W. c #74747B7BE4E4", -"Q. c #6D6D7676D6D6", -"!. c #6A6A7171CECE", -"~. c #66666969C6C6", -"^. c #62626565BCBC", -"/. c #5F5F6060B5B5", -"(. c #5B5B5B5BACAC", -"). c #535353539898", -"_. c #4F4F4F4FA4A4", -"`. c #54544D4DA4A4", -"'. c #323204046B6B", -"]. c #303035357979", -"[. c #313122224343", -"{. c #5A5A5B5BB7B7", -"}. c #484846468080", -"|. c #454541417575", -" X c #4B4B31318282", -".X c #47473C3C8484", -"XX c #3E3E35356E6E", -"oX c #2F2F26264040", -"OX c #2B2B23233A3A", -"+X c #262619195C5C", -"@X c #252515155A5A", -"#X c #55555151B3B3", -"$X c #3C3C2D2D5D5D", -"%X c #39392F2F5656", -"&X c #37372D2D5050", -"*X c #25251F1F3030", -"=X c #24241D1D4343", -"-X c #202013135656", -";X c #41413B3B6C6C", -":X c #444442429696", -">X c #212100005E5E", -",X c #444436367272", -" > , , , ", -" . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7 ", -" . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t ", -" . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t ", -" X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r ", -" X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r ", -" < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r ", -" < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r ", -" U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r ", -" ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } | .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r ", -" ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B ", -" ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I ", -" ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I ", -" 8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I ", -" 9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I ", -" <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F ", -" + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y. ", -" O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y. ", -" O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y. ", -" O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y. ", -" $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>. ", -" E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._. ", -" + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>. ", -" ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.} ", -" .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X ", -" E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._. ", -" & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X ", -" {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} } ", -" & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,XX7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X > > t t t cX ", -" nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t ", -" nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7 ", -" ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7 ", -" SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7 ", -" SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX ", -" SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX ", -" IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX ", -" "}; +/* XPM */ +static char * icon48_xpm[] = { +"48 48 256 2", +" c #4B4B3B3B9090", +". c #0D0D0E0E5454", +"X c #11110E0E5B5B", +"o c #17170F0F6363", +"O c #1D1D13136969", +"+ c #212114146C6C", +"@ c #252514147171", +"# c #282811116C6C", +"$ c #26260D0D6363", +"% c #22220B0B5E5E", +"& c #1C1C0B0B5A5A", +"* c #1C1C0B0B5252", +"= c #1B1B05055353", +"- c #161606064D4D", +"; c #161605054949", +": c #111104044848", +"> c #131304044545", +", c #131305054242", +"< c #141410105E5E", +"1 c #2C2C15157373", +"2 c #2B2B1B1B7575", +"3 c #343416167272", +"4 c #313113136E6E", +"5 c #222209095757", +"6 c #1B1B06064D4D", +"7 c #15150B0B4242", +"8 c #13130C0C5555", +"9 c #2E2E1B1B7878", +"0 c #33331F1F7C7C", +"q c #343418187878", +"w c #3B3B1C1C7575", +"e c #2E2E10106767", +"r c #1B1B07074747", +"t c #18180B0B4646", +"y c #151513136262", +"u c #1A1A15156464", +"i c #34341F1F7777", +"p c #40401E1E8080", +"a c #42421B1B7A7A", +"s c #3B3B15157474", +"d c #2B2B0B0B5B5B", +"f c #222207075252", +"g c #373727277A7A", +"h c #474724248484", +"j c #393915156E6E", +"k c #373711116A6A", +"l c #343413136363", +"z c #232319196E6E", +"x c #292919197070", +"c c #3C3C2C2C8282", +"v c #444431318585", +"b c #494934348A8A", +"n c #505026268A8A", +"m c #3D3D1B1B6E6E", +"M c #31310E0E5C5C", +"N c #2B2B0D0D5353", +"B c #222207074A4A", +"V c #52523C3C9292", +"C c #58583C3C9494", +"Z c #5D5D44449797", +"A c #5C5C2E2E9292", +"S c #676733339595", +"D c #424228287575", +"F c #29290A0A4F4F", +"G c #6C6C4A4A9E9E", +"H c #72725454A7A7", +"J c #8C8C6D6DB2B2", +"K c #343424246E6E", +"L c #3A3A23236A6A", +"P c #3A3A1C1C6767", +"I c #24240A0A4B4B", +"U c #151518186161", +"Y c #76766F6FA5A5", +"T c #ADAD9191CCCC", +"R c #98988989D3D3", +"E c #45453B3B8686", +"W c #3C3C35357979", +"Q c #363631317575", +"! c #32322D2D6B6B", +"~ c #323229296363", +"^ c #30301F1F6262", +"/ c #323218185E5E", +"( c #272707074B4B", +") c #202028286C6C", +"_ c #1E1E1D1D6868", +"` c #9A9A8282BBBB", +"' c #C8C8B3B3D3D3", +"] c #B3B3AFAFE7E7", +"[ c #84847272C6C6", +"{ c #58585757A3A3", +"} c #3F3F3C3C8A8A", +"| c #3B3B3A3A8484", +" . c #414139397D7D", +".. c #3D3D39397A7A", +"X. c #37372E2E6E6E", +"o. c #2C2C21215A5A", +"O. c #2E2E1B1B5B5B", +"+. c #F5F5EFEFF5F5", +"@. c #656566669A9A", +"#. c #47474B4B8E8E", +"$. c #3C3C44447B7B", +"%. c #444442428080", +"&. c #45453E3E8181", +"*. c #40403C3C8181", +"=. c #3D3D33337474", +"-. c #3B3B30306E6E", +";. c #38382D2D6969", +":. c #303026265D5D", +">. c #2C2C15155A5A", +",. c #1F1F1C1C7070", +"<. c #25251E1E7171", +"1. c #59595C5C9191", +"2. c #4D4D53538989", +"3. c #4C4C49498484", +"4. c #484845458585", +"5. c #494941418585", +"6. c #494940408181", +"7. c #2F2F1C1C5353", +"8. c #2B2B28287676", +"9. c #323231317F7F", +"0. c #545452528B8B", +"q. c #51514E4E8989", +"w. c #4E4E4B4B8C8C", +"e. c #4C4C47478686", +"r. c #46463D3D7E7E", +"t. c #434336367A7A", +"y. c #2B2B13135555", +"u. c #47473D3D8D8D", +"i. c #575757578E8E", +"p. c #48483E3E7F7F", +"a. c #46463A3A7D7D", +"s. c #424235357575", +"d. c #404034347171", +"f. c #BFBFCBCBFAFA", +"g. c #B8B8A8A8DDDD", +"h. c #5E5E60609292", +"j. c #565655558C8C", +"k. c #4B4B44448282", +"l. c #454539397B7B", +"z. c #434338387878", +"x. c #3F3F32326D6D", +"c. c #3D3D30306969", +"v. c #3A3A2E2E6363", +"b. c #36362A2A5C5C", +"n. c #343424245555", +"m. c #30301E1E4D4D", +"M. c #49493C3C8282", +"N. c #5E5E4F4F8C8C", +"B. c #56563B3B8B8B", +"V. c #545407078585", +"C. c #424234347272", +"Z. c #9797A4A4F7F7", +"A. c #444436367676", +"S. c #7D7D7979D5D5", +"D. c #464640408A8A", +"F. c #44444B4B8282", +"G. c #414107077777", +"H. c #71716161C1C1", +"J. c #303039397979", +"K. c #8E8E8E8EE6E6", +"L. c #404033338B8B", +"P. c #4A4A45458C8C", +"I. c #46463A3A8080", +"U. c #363629295454", +"Y. c #303022224848", +"T. c #424237377575", +"R. c #2E2E1D1D6363", +"E. c #79798383EAEA", +"W. c #74747B7BE4E4", +"Q. c #6D6D7676D6D6", +"!. c #6A6A7171CECE", +"~. c #66666969C6C6", +"^. c #62626565BCBC", +"/. c #5F5F6060B5B5", +"(. c #5B5B5B5BACAC", +"). c #535353539898", +"_. c #4F4F4F4FA4A4", +"`. c #54544D4DA4A4", +"'. c #323204046B6B", +"]. c #303035357979", +"[. c #313122224343", +"{. c #5A5A5B5BB7B7", +"}. c #484846468080", +"|. c #454541417575", +" X c #4B4B31318282", +".X c #47473C3C8484", +"XX c #3E3E35356E6E", +"oX c #2F2F26264040", +"OX c #2B2B23233A3A", +"+X c #262619195C5C", +"@X c #252515155A5A", +"#X c #55555151B3B3", +"$X c #3C3C2D2D5D5D", +"%X c #39392F2F5656", +"&X c #37372D2D5050", +"*X c #25251F1F3030", +"=X c #24241D1D4343", +"-X c #202013135656", +";X c #41413B3B6C6C", +":X c #444442429696", +">X c #212100005E5E", +",X c #444436367272", +" > , , , ", +" . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7 ", +" . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t ", +" . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t ", +" X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r ", +" X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r ", +" < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r ", +" < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r ", +" U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r ", +" ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } | .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r ", +" ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B ", +" ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I ", +" ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I ", +" 8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I ", +" 9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I ", +" <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F ", +" + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y. ", +" O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y. ", +" O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y. ", +" O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y. ", +" $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>. ", +" E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._. ", +" + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>. ", +" ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.} ", +" .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X ", +" E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._. ", +" & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X ", +" {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} } ", +" & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,XX7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X > > t t t cX ", +" nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t ", +" nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7 ", +" ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7 ", +" SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7 ", +" SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX ", +" SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX ", +" IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX ", +" "}; diff --git a/icons/alt_window_16.gif b/tutorial-plugin/icons/alt_window_16.gif similarity index 100% rename from icons/alt_window_16.gif rename to tutorial-plugin/icons/alt_window_16.gif diff --git a/icons/alt_window_32.gif b/tutorial-plugin/icons/alt_window_32.gif similarity index 100% rename from icons/alt_window_32.gif rename to tutorial-plugin/icons/alt_window_32.gif diff --git a/icons/jogleditor/resume_co.gif b/tutorial-plugin/icons/jogleditor/resume_co.gif similarity index 100% rename from icons/jogleditor/resume_co.gif rename to tutorial-plugin/icons/jogleditor/resume_co.gif diff --git a/icons/jogleditor/suspend_co.gif b/tutorial-plugin/icons/jogleditor/suspend_co.gif similarity index 100% rename from icons/jogleditor/suspend_co.gif rename to tutorial-plugin/icons/jogleditor/suspend_co.gif diff --git a/plugin.xml b/tutorial-plugin/plugin.xml similarity index 96% rename from plugin.xml rename to tutorial-plugin/plugin.xml index f7b49a7..39f8ee4 100644 --- a/plugin.xml +++ b/tutorial-plugin/plugin.xml @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorial-plugin/pom.xml b/tutorial-plugin/pom.xml new file mode 100755 index 0000000..ff26612 --- /dev/null +++ b/tutorial-plugin/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + + + name.wadewalker.tutorial + tutorial-parent + 1.0.0-SNAPSHOT + ../tutorial-parent + + + tutorial-plugin + eclipse-plugin + + JOGL Eclipse Tutorial Plugin + JOGL Eclipse Tutorial Plugin + + + src + + + + + com.jogamp.jogl + jogamp-bundle-all-main + + + + + diff --git a/splash.bmp b/tutorial-plugin/splash.bmp similarity index 100% rename from splash.bmp rename to tutorial-plugin/splash.bmp diff --git a/tutorial-plugin/src/com/jogamp/jogl/JoglLoader.java b/tutorial-plugin/src/com/jogamp/jogl/JoglLoader.java new file mode 100755 index 0000000..b8445dc --- /dev/null +++ b/tutorial-plugin/src/com/jogamp/jogl/JoglLoader.java @@ -0,0 +1,58 @@ +/** + * Original version + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * + * Stolen from Mr. Walker's: + * https://github.com/WadeWalker/name.wadewalker.tutorial + * name.wadewalker.tutorial.jogleditor.JOGLEditor.createPartControl(); + */ +package com.jogamp.jogl; + +import com.jogamp.common.util.JarUtil; + +import org.eclipse.core.runtime.FileLocator; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +/** + * Use Eclipse's {@link FileLocator} to resolve the JOGL bundle's + * embedded jars and native code bundles. + * + * Stolen from Copyright (c) 2010-2011 Wade Walker. + * Free for any use, but credit is appreciated. + */ +public class JoglLoader { + + /** + * Set the jar resolver for JOGL's {@link JarUtil}. + */ + public static void prepareJoglLoader() { + JarUtil.setResolver( new JarUtil.Resolver() { + public URL resolve( URL url ) { + try { + URL urlTest = FileLocator.resolve( url ); + // HACK: required because FileLocator.resolve() doesn't return an + // escaped URL, which makes conversion to a URI inside JOGL fail. + // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=145096 for details. + URI uriResolved = null; + try { + uriResolved = new URI(urlTest.getProtocol(), urlTest.getPath(), null); + } + catch( URISyntaxException urisyntaxexception ) { + // should never happen, since FileLocator's URLs should at least be syntactically correct + urisyntaxexception.printStackTrace(); + } + URL urlNew = uriResolved.toURL(); + return( urlNew ); + } + catch( IOException ioexception ) { + return( url ); + } + } + }); + } + +} diff --git a/src/name/wadewalker/tutorial/Activator.java b/tutorial-plugin/src/name/wadewalker/tutorial/Activator.java similarity index 97% rename from src/name/wadewalker/tutorial/Activator.java rename to tutorial-plugin/src/name/wadewalker/tutorial/Activator.java index 8620fd9..58982e9 100644 --- a/src/name/wadewalker/tutorial/Activator.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/Activator.java @@ -1,286 +1,286 @@ -package name.wadewalker.tutorial; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.Category; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.ParameterizedCommand; -import org.eclipse.core.commands.contexts.Context; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.bindings.Binding; -import org.eclipse.jface.bindings.Scheme; -import org.eclipse.jface.bindings.keys.KeyBinding; -import org.eclipse.jface.bindings.keys.KeySequence; -import org.eclipse.jface.bindings.keys.ParseException; -import org.eclipse.jface.commands.ActionHandler; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IWorkbenchPartSite; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.contexts.IContextService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.ui.keys.IBindingService; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -//============================================================================== -/** - * The activator class controls the plug-in life cycle. - * - * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. - * @author Wade Walker - */ -public class Activator extends AbstractUIPlugin { - - /** The plug-in ID. */ - public static final String ssPluginID = "name.wadewalker.tutorial"; //$NON-NLS-1$ - - /** The shared instance. */ - private static Activator sactivator; - - /** Eclipse package needed during key binding. */ - private static final String ssDefaultSchemeID = "org.eclipse.ui.defaultAcceleratorConfiguration"; - - /** Eclipse package needed during key binding. */ - private static final String ssParentContextID = "org.eclipse.ui.contexts.window"; - - /** ID of command category used in key binding. */ - private static final String ssCommandCategoryID = "Tutorial.commands.category"; - - /** Name of command category used in key binding. */ - private static final String ssCommandCategoryName = "Tutorial commands"; - - /** ID of command context used in key binding. */ - private static final String ssContextID = "viewerKeyContext"; - - /** Name of command context used in key binding. */ - private static final String ssContextName = "In Placement Editor"; - - //============================================================================== - /** - * Constructor. - */ - public Activator() { - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public void start( BundleContext bundlecontext ) throws Exception { - super.start( bundlecontext ); - sactivator = this; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public void stop( BundleContext bundlecontext ) throws Exception { - sactivator = null; - super.stop( bundlecontext ); - } - - //============================================================================== - /** - * Accessor. - * - * @return the shared instance. - */ - public static Activator getDefault() { - return sactivator; - } - - //============================================================================== - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path. - * - * @param sPath the path - * @return the image descriptor. - */ - public static ImageDescriptor getImageDescriptor( String sPath ) { - return imageDescriptorFromPlugin( ssPluginID, sPath ); - } - - //============================================================================== - /** - * Returns an image descriptor for the specified icon. - * - * @param sIconPath Path to the icon file inside the "icons" - * directory of the plugin project. - * @return the image descriptor for the specified icon. - */ - public static ImageDescriptor getIcon( String sIconPath ) { - - ImageDescriptor imagedescriptor = Activator.getImageDescriptor( "icons/" + sIconPath ); - if( imagedescriptor == null ) - imagedescriptor = ImageDescriptor.getMissingImageDescriptor(); - - return( imagedescriptor ); - } - - //============================================================================== - /** - * Opens an error dialog box and logs the error. - * @param sDialogTitle Title of dialog box. - * @param istatus Status object to get message from. - */ - public static void openError( String sDialogTitle, IStatus istatus ) { - ErrorDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - sDialogTitle, - null, - istatus ); - Activator.getDefault().log( sDialogTitle + " : " + istatus.getMessage() ); - } - - //============================================================================== - /** - * Opens an "internal error" dialog box and logs the error. - * @param exception Exception containing the message to put in the dialog box. - */ - public static void openError( Exception exception ) { - openError( "Internal error", new Status( Status.ERROR, - Activator.ssPluginID, - exception.getMessage() != null - ? exception.getMessage() - : exception.getClass().toString() ) ); - Activator.getDefault().log( exception.getMessage(), exception ); - } - - //============================================================================== - /** - * Opens an error dialog box and logs the error. - * @param sDialogTitle Dialog box title. - * @param sMessage Message to put in dialog box. - */ - public static void openError( String sDialogTitle, String sMessage ) { - openError( sDialogTitle, new Status( Status.ERROR, Activator.ssPluginID, sMessage ) ); - Activator.getDefault().log( sDialogTitle + " : " + sMessage ); - } - - //============================================================================== - /** - * Prints a message to the Eclipse log. - * - * @param sMessage Message to print. - */ - public void log( String sMessage ) { - log( sMessage, null ); - } - - //============================================================================== - /** - * Prints a message to the Eclipse log. - * - * @param sMessage Message to print. - * @param exception Exception we're logging. - */ - public void log( String sMessage, Exception exception ) { - getLog().log( new Status( Status.INFO, ssPluginID, Status.OK, sMessage, exception ) ); - } - - //============================================================================== - /** - * Creates key bindings for an array of actions, saving them to - * the preference store if needed. - * - * Only creates a new key sequence if one doesn't exist for this - * context; otherwise, leaves any altered user preferences in place. - * - * Takes an array so the number of writes to the preference store - * can be minimized. - * - * TODO: this code is using the binding service in a way that - * Paul Webster (the guy responsible for this part of Eclipse) - * seems uncomfortable with, but right now there's no other option. - * This code may be able to be replaced after Eclipse 3.4 sometime, - * when PW finally puts in a programmatic interface for this. - * - * @param aiaction Actions to create key binding for. - * @param asKey Keys to bind actions to (in the format required by KeySequence). - * If the key string of an action is null, this method still activates - * a handler and defines this action's command, which is needed to stop - * some logged warnings when showing actions in menus. - * @param iworkbenchpartsite Site to do the binding at. - * @throws ParseException if one of the key strings can't be parsed. - * @throws IOException if the key bindings can't be saved to the preference store. - */ - public static void createKeyBinding( IAction [] aiaction, - String [] asKey, - IWorkbenchPartSite iworkbenchpartsite ) - throws ParseException, IOException { - assert( aiaction.length == asKey.length ); - - // services outside loop for speed - IHandlerService ihandlerservice = (IHandlerService)iworkbenchpartsite.getService( IHandlerService.class ); - ICommandService icommandservice = (ICommandService)iworkbenchpartsite.getService( ICommandService.class ); - IContextService icontextservice = (IContextService)iworkbenchpartsite.getService( IContextService.class ); - IBindingService ibindingservice = (IBindingService)PlatformUI.getWorkbench().getAdapter( IBindingService.class ); - - // current bindings - Binding [] abinding = ibindingservice.getBindings(); - - // new bindings - List listNewBindings = new ArrayList( 0 ); - - for( int i = 0; i < aiaction.length; i++ ) { - - ActionHandler actionhandler = new ActionHandler( aiaction[i] ); - ihandlerservice.activateHandler( aiaction[i].getActionDefinitionId(), actionhandler ); - - Category category = icommandservice.getCategory( ssCommandCategoryID ); - if( !category.isDefined() ) - category.define( ssCommandCategoryName, null ); - - Command command = icommandservice.getCommand( aiaction[i].getActionDefinitionId() ); - if( !command.isDefined() ) - command.define( aiaction[i].getText(), aiaction[i].getDescription(), category ); - - Context context = icontextservice.getContext( ssContextID ); - if( !context.isDefined() ) - context.define( ssContextName, null, ssParentContextID ); - - icontextservice.activateContext( ssContextID ); - - boolean bCreateNewBinding = true; - - // make sure the binding doesn't already exist for this context - for( Binding binding : abinding ) { - if( (binding.getParameterizedCommand() != null) - && binding.getParameterizedCommand().getCommand().getId().equals( aiaction[i].getActionDefinitionId() ) - && binding.getContextId().equals( ssContextID ) ) - bCreateNewBinding = false; - } - - if( bCreateNewBinding && (asKey[i] != null) ) { - ParameterizedCommand parameterizedcommand = new ParameterizedCommand( command, null ); - KeySequence keysequence = KeySequence.getInstance( asKey[i] ); - listNewBindings.add( new KeyBinding( keysequence, parameterizedcommand, - ssDefaultSchemeID, ssContextID, - null, null, null, - Binding.USER ) ); - } - } - - if( listNewBindings.size() == 0 ) - return; - - // add new bindings to current and save them - Binding [] abindingNew = listNewBindings.toArray( new Binding [] {} ); - Binding [] abindingPlusNew = new Binding[abinding.length + abindingNew.length]; - - System.arraycopy( abinding, 0, abindingPlusNew, 0, abinding.length ); - System.arraycopy( abindingNew, 0, abindingPlusNew, abinding.length, abindingNew.length ); - - Scheme schemeDefault = ibindingservice.getScheme( ssDefaultSchemeID ); - ibindingservice.savePreferences( schemeDefault, abindingPlusNew ); - } +package name.wadewalker.tutorial; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.Category; +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ParameterizedCommand; +import org.eclipse.core.commands.contexts.Context; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.bindings.Binding; +import org.eclipse.jface.bindings.Scheme; +import org.eclipse.jface.bindings.keys.KeyBinding; +import org.eclipse.jface.bindings.keys.KeySequence; +import org.eclipse.jface.bindings.keys.ParseException; +import org.eclipse.jface.commands.ActionHandler; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IWorkbenchPartSite; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.contexts.IContextService; +import org.eclipse.ui.handlers.IHandlerService; +import org.eclipse.ui.keys.IBindingService; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +//============================================================================== +/** + * The activator class controls the plug-in life cycle. + * + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * @author Wade Walker + */ +public class Activator extends AbstractUIPlugin { + + /** The plug-in ID. */ + public static final String ssPluginID = "tutorial-plugin"; //$NON-NLS-1$ + + /** The shared instance. */ + private static Activator sactivator; + + /** Eclipse package needed during key binding. */ + private static final String ssDefaultSchemeID = "org.eclipse.ui.defaultAcceleratorConfiguration"; + + /** Eclipse package needed during key binding. */ + private static final String ssParentContextID = "org.eclipse.ui.contexts.window"; + + /** ID of command category used in key binding. */ + private static final String ssCommandCategoryID = "Tutorial.commands.category"; + + /** Name of command category used in key binding. */ + private static final String ssCommandCategoryName = "Tutorial commands"; + + /** ID of command context used in key binding. */ + private static final String ssContextID = "viewerKeyContext"; + + /** Name of command context used in key binding. */ + private static final String ssContextName = "In Placement Editor"; + + //============================================================================== + /** + * Constructor. + */ + public Activator() { + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public void start( BundleContext bundlecontext ) throws Exception { + super.start( bundlecontext ); + sactivator = this; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public void stop( BundleContext bundlecontext ) throws Exception { + sactivator = null; + super.stop( bundlecontext ); + } + + //============================================================================== + /** + * Accessor. + * + * @return the shared instance. + */ + public static Activator getDefault() { + return sactivator; + } + + //============================================================================== + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path. + * + * @param sPath the path + * @return the image descriptor. + */ + public static ImageDescriptor getImageDescriptor( String sPath ) { + return imageDescriptorFromPlugin( ssPluginID, sPath ); + } + + //============================================================================== + /** + * Returns an image descriptor for the specified icon. + * + * @param sIconPath Path to the icon file inside the "icons" + * directory of the plugin project. + * @return the image descriptor for the specified icon. + */ + public static ImageDescriptor getIcon( String sIconPath ) { + + ImageDescriptor imagedescriptor = Activator.getImageDescriptor( "icons/" + sIconPath ); + if( imagedescriptor == null ) + imagedescriptor = ImageDescriptor.getMissingImageDescriptor(); + + return( imagedescriptor ); + } + + //============================================================================== + /** + * Opens an error dialog box and logs the error. + * @param sDialogTitle Title of dialog box. + * @param istatus Status object to get message from. + */ + public static void openError( String sDialogTitle, IStatus istatus ) { + ErrorDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), + sDialogTitle, + null, + istatus ); + Activator.getDefault().log( sDialogTitle + " : " + istatus.getMessage() ); + } + + //============================================================================== + /** + * Opens an "internal error" dialog box and logs the error. + * @param exception Exception containing the message to put in the dialog box. + */ + public static void openError( Exception exception ) { + openError( "Internal error", new Status( Status.ERROR, + Activator.ssPluginID, + exception.getMessage() != null + ? exception.getMessage() + : exception.getClass().toString() ) ); + Activator.getDefault().log( exception.getMessage(), exception ); + } + + //============================================================================== + /** + * Opens an error dialog box and logs the error. + * @param sDialogTitle Dialog box title. + * @param sMessage Message to put in dialog box. + */ + public static void openError( String sDialogTitle, String sMessage ) { + openError( sDialogTitle, new Status( Status.ERROR, Activator.ssPluginID, sMessage ) ); + Activator.getDefault().log( sDialogTitle + " : " + sMessage ); + } + + //============================================================================== + /** + * Prints a message to the Eclipse log. + * + * @param sMessage Message to print. + */ + public void log( String sMessage ) { + log( sMessage, null ); + } + + //============================================================================== + /** + * Prints a message to the Eclipse log. + * + * @param sMessage Message to print. + * @param exception Exception we're logging. + */ + public void log( String sMessage, Exception exception ) { + getLog().log( new Status( Status.INFO, ssPluginID, Status.OK, sMessage, exception ) ); + } + + //============================================================================== + /** + * Creates key bindings for an array of actions, saving them to + * the preference store if needed. + * + * Only creates a new key sequence if one doesn't exist for this + * context; otherwise, leaves any altered user preferences in place. + * + * Takes an array so the number of writes to the preference store + * can be minimized. + * + * TODO: this code is using the binding service in a way that + * Paul Webster (the guy responsible for this part of Eclipse) + * seems uncomfortable with, but right now there's no other option. + * This code may be able to be replaced after Eclipse 3.4 sometime, + * when PW finally puts in a programmatic interface for this. + * + * @param aiaction Actions to create key binding for. + * @param asKey Keys to bind actions to (in the format required by KeySequence). + * If the key string of an action is null, this method still activates + * a handler and defines this action's command, which is needed to stop + * some logged warnings when showing actions in menus. + * @param iworkbenchpartsite Site to do the binding at. + * @throws ParseException if one of the key strings can't be parsed. + * @throws IOException if the key bindings can't be saved to the preference store. + */ + public static void createKeyBinding( IAction [] aiaction, + String [] asKey, + IWorkbenchPartSite iworkbenchpartsite ) + throws ParseException, IOException { + assert( aiaction.length == asKey.length ); + + // services outside loop for speed + IHandlerService ihandlerservice = (IHandlerService)iworkbenchpartsite.getService( IHandlerService.class ); + ICommandService icommandservice = (ICommandService)iworkbenchpartsite.getService( ICommandService.class ); + IContextService icontextservice = (IContextService)iworkbenchpartsite.getService( IContextService.class ); + IBindingService ibindingservice = (IBindingService)PlatformUI.getWorkbench().getAdapter( IBindingService.class ); + + // current bindings + Binding [] abinding = ibindingservice.getBindings(); + + // new bindings + List listNewBindings = new ArrayList( 0 ); + + for( int i = 0; i < aiaction.length; i++ ) { + + ActionHandler actionhandler = new ActionHandler( aiaction[i] ); + ihandlerservice.activateHandler( aiaction[i].getActionDefinitionId(), actionhandler ); + + Category category = icommandservice.getCategory( ssCommandCategoryID ); + if( !category.isDefined() ) + category.define( ssCommandCategoryName, null ); + + Command command = icommandservice.getCommand( aiaction[i].getActionDefinitionId() ); + if( !command.isDefined() ) + command.define( aiaction[i].getText(), aiaction[i].getDescription(), category ); + + Context context = icontextservice.getContext( ssContextID ); + if( !context.isDefined() ) + context.define( ssContextName, null, ssParentContextID ); + + icontextservice.activateContext( ssContextID ); + + boolean bCreateNewBinding = true; + + // make sure the binding doesn't already exist for this context + for( Binding binding : abinding ) { + if( (binding.getParameterizedCommand() != null) + && binding.getParameterizedCommand().getCommand().getId().equals( aiaction[i].getActionDefinitionId() ) + && binding.getContextId().equals( ssContextID ) ) + bCreateNewBinding = false; + } + + if( bCreateNewBinding && (asKey[i] != null) ) { + ParameterizedCommand parameterizedcommand = new ParameterizedCommand( command, null ); + KeySequence keysequence = KeySequence.getInstance( asKey[i] ); + listNewBindings.add( new KeyBinding( keysequence, parameterizedcommand, + ssDefaultSchemeID, ssContextID, + null, null, null, + Binding.USER ) ); + } + } + + if( listNewBindings.size() == 0 ) + return; + + // add new bindings to current and save them + Binding [] abindingNew = listNewBindings.toArray( new Binding [] {} ); + Binding [] abindingPlusNew = new Binding[abinding.length + abindingNew.length]; + + System.arraycopy( abinding, 0, abindingPlusNew, 0, abinding.length ); + System.arraycopy( abindingNew, 0, abindingPlusNew, abinding.length, abindingNew.length ); + + Scheme schemeDefault = ibindingservice.getScheme( ssDefaultSchemeID ); + ibindingservice.savePreferences( schemeDefault, abindingPlusNew ); + } } \ No newline at end of file diff --git a/src/name/wadewalker/tutorial/Application.java b/tutorial-plugin/src/name/wadewalker/tutorial/Application.java similarity index 95% rename from src/name/wadewalker/tutorial/Application.java rename to tutorial-plugin/src/name/wadewalker/tutorial/Application.java index 0384fa7..dd94853 100644 --- a/src/name/wadewalker/tutorial/Application.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/Application.java @@ -6,6 +6,8 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; +import com.jogamp.jogl.JoglLoader; + //============================================================================== /** * This class controls what happens when the app starts and stops. This is RCP @@ -23,6 +25,8 @@ public class Application implements IApplication { @Override public Object start( IApplicationContext iapplicationcontext ) throws Exception { Display display = PlatformUI.createDisplay(); + JoglLoader.prepareJoglLoader(); + try { int iReturnCode = PlatformUI.createAndRunWorkbench( display, new ApplicationWorkbenchAdvisor() ); if (iReturnCode == PlatformUI.RETURN_RESTART) diff --git a/src/name/wadewalker/tutorial/ApplicationActionBarAdvisor.java b/tutorial-plugin/src/name/wadewalker/tutorial/ApplicationActionBarAdvisor.java similarity index 100% rename from src/name/wadewalker/tutorial/ApplicationActionBarAdvisor.java rename to tutorial-plugin/src/name/wadewalker/tutorial/ApplicationActionBarAdvisor.java diff --git a/src/name/wadewalker/tutorial/ApplicationWorkbenchAdvisor.java b/tutorial-plugin/src/name/wadewalker/tutorial/ApplicationWorkbenchAdvisor.java similarity index 100% rename from src/name/wadewalker/tutorial/ApplicationWorkbenchAdvisor.java rename to tutorial-plugin/src/name/wadewalker/tutorial/ApplicationWorkbenchAdvisor.java diff --git a/src/name/wadewalker/tutorial/ApplicationWorkbenchWindowAdvisor.java b/tutorial-plugin/src/name/wadewalker/tutorial/ApplicationWorkbenchWindowAdvisor.java similarity index 100% rename from src/name/wadewalker/tutorial/ApplicationWorkbenchWindowAdvisor.java rename to tutorial-plugin/src/name/wadewalker/tutorial/ApplicationWorkbenchWindowAdvisor.java diff --git a/src/name/wadewalker/tutorial/DataSource.java b/tutorial-plugin/src/name/wadewalker/tutorial/DataSource.java similarity index 96% rename from src/name/wadewalker/tutorial/DataSource.java rename to tutorial-plugin/src/name/wadewalker/tutorial/DataSource.java index 894691b..eb8b87d 100644 --- a/src/name/wadewalker/tutorial/DataSource.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/DataSource.java @@ -1,187 +1,187 @@ -package name.wadewalker.tutorial; - -import java.util.ArrayList; -import java.util.List; - -//============================================================================== -/** - * A source of some time-varying data. In this case, it's - * a traveling sine wave drawn with a set of quads. - * - * This data source is supposed to mimic something like a dynamically - * changing graph or fluid field, where you can't just draw the - * same static object over and over -- you have to stream it to - * the graphics card on every frame. - * - * Copyright (c) 2010 Wade Walker. Free for any use, but credit is appreciated. - * - * @author Wade Walker - * @version 1.0 - */ -public class DataSource { - - /** Number of x increments going across the data. */ - protected static final int siXIncrements = 300000; - - /** Tracks the current time it arbitrary units. */ - protected double dT; - - /** List of data objects in this application. */ - protected List listDataObjects; - - /** Represents some piece of data to be drawn. */ - public class DataObject { - /** X coordinate of object origin. */ - private double dX; - - /** Y coordinate of object origin. */ - private double dY; - - /** Width of object. */ - private double dWidth; - - /** Height of object. */ - private double dHeight; - - /** RGB color components. */ - private float [] afColor; - - //============================================================================== - /** - * Constructor. - */ - public DataObject() { - } - - //============================================================================== - /** - * Accessor. - * @return {@link #dX} - */ - public float getX() { - return( (float)dX ); - } - - //============================================================================== - /** - * Accessor. - * @param dXParam {@link #dX} - */ - public void setX( double dXParam ) { - dX = dXParam; - } - - //============================================================================== - /** - * Accessor. - * @return {@link #dY} - */ - public float getY() { - return( (float)dY ); - } - - //============================================================================== - /** - * Accessor. - * @param dYParam {@link #dY} - */ - public void setY( double dYParam ) { - dY = dYParam; - } - - //============================================================================== - /** - * Accessor. - * @return {@link #dWidth} - */ - public float getWidth() { - return( (float)dWidth ); - } - - //============================================================================== - /** - * Accessor. - * @param dWidthParam {@link #dWidth} - */ - public void setWidth( double dWidthParam ) { - dWidth = dWidthParam; - } - - //============================================================================== - /** - * Accessor. - * @return {@link #dHeight} - */ - public float getHeight() { - return( (float)dHeight ); - } - - //============================================================================== - /** - * Accessor. - * @param dHeightParam {@link #dHeight} - */ - public void setHeight( double dHeightParam ) { - dHeight = dHeightParam; - } - - //============================================================================== - /** - * Accessor. - * @return {@link #afColor} - */ - public float [] getColor() { - return( afColor ); - } - - //============================================================================== - /** - * Accessor. - * @param afColorParam {@link #afColor} - */ - public void setColor( float [] afColorParam ) { - afColor = afColorParam; - } - } - - //============================================================================== - /** - * Constructor. Creates empty data objects with random colors. - */ - public DataSource() { - listDataObjects = new ArrayList(); - for( int i = 0; i < siXIncrements; i++ ) { - DataObject dataobject = new DataObject(); - dataobject.setColor( new float [] {(float)Math.random(), (float)Math.random(), (float)Math.random()} ); - listDataObjects.add( dataobject ); - } - } - - //============================================================================== - /** - * Updates the data objects to the current time and returns them. - * @return a list of the data objects. - */ - public List getData() { - double dXIncrement = 2.0 * Math.PI * (1.0 / siXIncrements); - double dX = -Math.PI; - for( int i = 0; i < siXIncrements; dX += dXIncrement, i++ ) { - double dY = Math.sin( dX + dT ); - DataObject dataobject = listDataObjects.get( i ); - dataobject.setX( dX ); - dataobject.setY( dY > 0 ? 0 : dY ); - dataobject.setWidth( dXIncrement ); - dataobject.setHeight( Math.abs( dY ) ); - } - return( listDataObjects ); - } - - //============================================================================== - /** - * Increments the current time. - * @param dDeltaT Amount to increment time by, in arbitrary units. - */ - public void incrementTime( double dDeltaT ) { - dT += dDeltaT; - } -} +package name.wadewalker.tutorial; + +import java.util.ArrayList; +import java.util.List; + +//============================================================================== +/** + * A source of some time-varying data. In this case, it's + * a traveling sine wave drawn with a set of quads. + * + * This data source is supposed to mimic something like a dynamically + * changing graph or fluid field, where you can't just draw the + * same static object over and over -- you have to stream it to + * the graphics card on every frame. + * + * Copyright (c) 2010 Wade Walker. Free for any use, but credit is appreciated. + * + * @author Wade Walker + * @version 1.0 + */ +public class DataSource { + + /** Number of x increments going across the data. */ + protected static final int siXIncrements = 300000; + + /** Tracks the current time it arbitrary units. */ + protected double dT; + + /** List of data objects in this application. */ + protected List listDataObjects; + + /** Represents some piece of data to be drawn. */ + public class DataObject { + /** X coordinate of object origin. */ + private double dX; + + /** Y coordinate of object origin. */ + private double dY; + + /** Width of object. */ + private double dWidth; + + /** Height of object. */ + private double dHeight; + + /** RGB color components. */ + private float [] afColor; + + //============================================================================== + /** + * Constructor. + */ + public DataObject() { + } + + //============================================================================== + /** + * Accessor. + * @return {@link #dX} + */ + public float getX() { + return( (float)dX ); + } + + //============================================================================== + /** + * Accessor. + * @param dXParam {@link #dX} + */ + public void setX( double dXParam ) { + dX = dXParam; + } + + //============================================================================== + /** + * Accessor. + * @return {@link #dY} + */ + public float getY() { + return( (float)dY ); + } + + //============================================================================== + /** + * Accessor. + * @param dYParam {@link #dY} + */ + public void setY( double dYParam ) { + dY = dYParam; + } + + //============================================================================== + /** + * Accessor. + * @return {@link #dWidth} + */ + public float getWidth() { + return( (float)dWidth ); + } + + //============================================================================== + /** + * Accessor. + * @param dWidthParam {@link #dWidth} + */ + public void setWidth( double dWidthParam ) { + dWidth = dWidthParam; + } + + //============================================================================== + /** + * Accessor. + * @return {@link #dHeight} + */ + public float getHeight() { + return( (float)dHeight ); + } + + //============================================================================== + /** + * Accessor. + * @param dHeightParam {@link #dHeight} + */ + public void setHeight( double dHeightParam ) { + dHeight = dHeightParam; + } + + //============================================================================== + /** + * Accessor. + * @return {@link #afColor} + */ + public float [] getColor() { + return( afColor ); + } + + //============================================================================== + /** + * Accessor. + * @param afColorParam {@link #afColor} + */ + public void setColor( float [] afColorParam ) { + afColor = afColorParam; + } + } + + //============================================================================== + /** + * Constructor. Creates empty data objects with random colors. + */ + public DataSource() { + listDataObjects = new ArrayList(); + for( int i = 0; i < siXIncrements; i++ ) { + DataObject dataobject = new DataObject(); + dataobject.setColor( new float [] {(float)Math.random(), (float)Math.random(), (float)Math.random()} ); + listDataObjects.add( dataobject ); + } + } + + //============================================================================== + /** + * Updates the data objects to the current time and returns them. + * @return a list of the data objects. + */ + public List getData() { + double dXIncrement = 2.0 * Math.PI * (1.0 / siXIncrements); + double dX = -Math.PI; + for( int i = 0; i < siXIncrements; dX += dXIncrement, i++ ) { + double dY = Math.sin( dX + dT ); + DataObject dataobject = listDataObjects.get( i ); + dataobject.setX( dX ); + dataobject.setY( dY > 0 ? 0 : dY ); + dataobject.setWidth( dXIncrement ); + dataobject.setHeight( Math.abs( dY ) ); + } + return( listDataObjects ); + } + + //============================================================================== + /** + * Increments the current time. + * @param dDeltaT Amount to increment time by, in arbitrary units. + */ + public void incrementTime( double dDeltaT ) { + dT += dDeltaT; + } +} diff --git a/src/name/wadewalker/tutorial/Perspective.java b/tutorial-plugin/src/name/wadewalker/tutorial/Perspective.java similarity index 100% rename from src/name/wadewalker/tutorial/Perspective.java rename to tutorial-plugin/src/name/wadewalker/tutorial/Perspective.java diff --git a/src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java similarity index 90% rename from src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java rename to tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java index 8e840a2..7a57f9b 100644 --- a/src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditor.java @@ -1,479 +1,450 @@ -package name.wadewalker.tutorial.jogleditor; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; -import java.util.List; - -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2ES1; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLProfile; -import javax.media.opengl.fixedfunc.GLMatrixFunc; -import javax.media.opengl.glu.GLU; - -import com.jogamp.common.nio.Buffers; -import com.jogamp.common.util.JarUtil; - -import name.wadewalker.tutorial.Activator; -import name.wadewalker.tutorial.DataSource; -import name.wadewalker.tutorial.DataSource.DataObject; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.bindings.keys.ParseException; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.opengl.GLCanvas; -import org.eclipse.swt.opengl.GLData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.EditorPart; - -//============================================================================== -/** - * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. - * @author Wade Walker - */ -public class JOGLEditor extends EditorPart { - - /** Workbench uses this ID to refer to instances of this type of editor. */ - public static final String ssID = "name.wadewalker.tutorial.jogleditor"; - - /** Constant used in FPS calculation. */ - protected static final long slMillisecondsPerSecond = 1000; - - /** Ratio of world-space units to screen pixels. - * Increasing this zooms the display out, - * decreasing it zooms the display in. */ - protected static final float sfObjectUnitsPerPixel = 0.03f; - - /** Amount to increment time on each sim step. */ - protected static final double sdTimeStep = 0.005; - - /** Milliseconds to sleep in each render cycle. */ - protected static final int siSleepPerStepMS = 1; - - /** Holds the OpenGL canvas. */ - protected Composite composite; - - /** Widget that displays OpenGL content. */ - protected GLCanvas glcanvas; - - /** Used to get OpenGL object that we need to access OpenGL functions. */ - protected GLContext glcontext; - - /** Source of data to draw. */ - protected DataSource datasource; - - /** X distance to translate the viewport by. */ - protected float fViewTranslateX; - - /** Y distance to translate the viewport by. */ - protected float fViewTranslateY; - - /** Index of vertex buffer object. We store interleaved vertex and color data here - * like this: x0, r0, y0, g0, z0, b0, x1, r1, y1, g1, z1, b1... - * Stored in an array because glGenBuffers requires it. */ - protected int [] aiVertexBufferIndices = new int [] {-1}; - - /** Number of frames drawn since last FPS calculation. */ - protected int iFPSFrames; - - /** Time in milliseconds at start of FPS calculation interval. */ - protected long lFPSIntervalStartTimeMS; - - //============================================================================== - /** - * Constructor. - */ - public JOGLEditor() { - datasource = new DataSource(); - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public void doSave( IProgressMonitor iprogressmonitor ) { - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public void doSaveAs() { - } - - //============================================================================== - /** - *

Sets up key action handlers.

- * {@inheritDoc} - */ - @Override - public void init( IEditorSite ieditorsite, IEditorInput ieditorinput ) throws PartInitException { - - setSite( ieditorsite ); - if( ieditorinput != null ) - setInput( ieditorinput ); - - // create action handlers - try { - Activator.createKeyBinding( - new IAction [] { - ieditorsite.getActionBars().getGlobalActionHandler( RunPauseAction.ssID ), - }, - new String [] { - "Space", - }, - getSite() ); - } - catch( ParseException parseexception ) { - throw new PartInitException( parseexception.getMessage() ); - } - catch( IOException ioexception ) { - throw new PartInitException( ioexception.getMessage() ); - } - } - - //============================================================================== - /** - * Disposes all OpenGL resources in case this view is closed and reopened. - * @see org.eclipse.ui.part.WorkbenchPart#dispose() - */ - @Override - public void dispose() { - disposeVertexBuffers(); - glcanvas.dispose(); - super.dispose(); - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public boolean isDirty() { - return false; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public boolean isSaveAsAllowed() { - return false; - } - - //============================================================================== - /** - *

Sets up an OpenGL canvas to draw in.

- * {@inheritDoc} - */ - @Override - public void createPartControl( Composite compositeParent ) { - JarUtil.setResolver( new JarUtil.Resolver() { - public URL resolve( URL url ) { - try { - URL urlTest = FileLocator.resolve( url ); - // HACK: required because FileLocator.resolve() doesn't return an - // escaped URL, which makes conversion to a URI inside JOGL fail. - // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=145096 for details. - URI uriResolved = null; - try { - uriResolved = new URI(urlTest.getProtocol(), urlTest.getPath(), null); - } - catch( URISyntaxException urisyntaxexception ) { - // should never happen, since FileLocator's URLs should at least be syntactically correct - urisyntaxexception.printStackTrace(); - } - URL urlNew = uriResolved.toURL(); - return( urlNew ); - } - catch( IOException ioexception ) { - return( url ); - } - } - } ); - - GLProfile glprofile = GLProfile.get( GLProfile.GL2 ); - - composite = new Composite( compositeParent, SWT.NONE ); - composite.setLayout( new FillLayout() ); - - GLData gldata = new GLData(); - gldata.doubleBuffer = true; - glcanvas = new GLCanvas( composite, SWT.NO_BACKGROUND, gldata ); - glcanvas.setCurrent(); - glcontext = GLDrawableFactory.getFactory( glprofile ).createExternalGLContext(); - - glcanvas.addListener( SWT.Resize, new Listener() { - public void handleEvent( Event event ) { - glcanvas.setCurrent(); - glcontext.makeCurrent(); - GL2 gl2 = glcontext.getGL().getGL2(); - setTransformsAndViewport( gl2 ); - glcontext.release(); - } - }); - - glcontext.makeCurrent(); - GL2 gl2 = glcontext.getGL().getGL2(); - gl2.setSwapInterval( 1 ); - gl2.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); - gl2.glColor3f( 1.0f, 0.0f, 0.0f ); - gl2.glHint( GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST ); - gl2.glClearDepth( 1.0 ); - gl2.glLineWidth( 2 ); - gl2.glEnable( GL.GL_DEPTH_TEST ); - glcontext.release(); - - // spawn a worker thread to call the renderer in a loop until the program closes. - (new Thread() { - public void run() { - - // look at the run/pause button state to see whether we should be running or not - RunPauseAction runpauseaction = (RunPauseAction)getEditorSite().getActionBars().getGlobalActionHandler( RunPauseAction.ssID ); - - // render once to get it on screen (we start out paused) - render(); - - try { - while( (glcanvas != null) && !glcanvas.isDisposed() ) { - // if we're running, render in the GUI thread - if( runpauseaction.isRunning() ) - render(); - // else we're paused, so sleep for a little so we don't peg the CPU - else - sleep( siSleepPerStepMS ); - } - } - catch( InterruptedException interruptedexception ) { - // if sleep interrupted just let the thread quite - } - } - }).start(); - } - - //============================================================================== - /** - * Calculates the FPS and shows it in the status line. - */ - protected void calculateAndShowFPS() { - ++iFPSFrames; - long lTime = System.currentTimeMillis(); - // update the FPS (once per second at most, to avoid flooding - // the UI with text updates) - long lTimeIntervalMS = lTime - lFPSIntervalStartTimeMS; - if( lTimeIntervalMS >= slMillisecondsPerSecond ) { - lFPSIntervalStartTimeMS = lTime; - int iFPS = (int)((double)(iFPSFrames * slMillisecondsPerSecond) / (double)lTimeIntervalMS); - iFPSFrames = 0; - getEditorSite().getActionBars().getStatusLineManager().setMessage( String.format( "FPS: %d", iFPS ) ); - } - } - - //============================================================================== - /** - * Renders into the GUI thread synchronously. Meant to be called - * from a worker thread. - */ - private void render() { - - PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable() { - public void run() { - if( (glcanvas != null) && !glcanvas.isDisposed() ) { - glcanvas.setCurrent(); - glcontext.makeCurrent(); - GL2 gl2 = glcontext.getGL().getGL2(); - gl2.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ); - gl2.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); - - // create vertex buffers if needed, then copy data in - int [] aiNumOfVertices = createAndFillVertexBuffer( gl2, datasource.getData() ); - - // needed so material for quads will be set from color map - gl2.glColorMaterial( GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE ); - gl2.glEnable( GL2.GL_COLOR_MATERIAL ); - - // draw all quads in vertex buffer - gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); - gl2.glEnableClientState( GL2.GL_VERTEX_ARRAY ); - gl2.glEnableClientState( GL2.GL_COLOR_ARRAY ); - gl2.glVertexPointer( 3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 0 ); - gl2.glColorPointer( 3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 3 * Buffers.SIZEOF_FLOAT ); - gl2.glPolygonMode( GL.GL_FRONT, GL2.GL_FILL ); - gl2.glDrawArrays( GL2.GL_QUADS, 0, aiNumOfVertices[0] ); - - // disable arrays once we're done - gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, 0 ); - gl2.glDisableClientState( GL2.GL_VERTEX_ARRAY ); - gl2.glDisableClientState( GL2.GL_COLOR_ARRAY ); - gl2.glDisable( GL2.GL_COLOR_MATERIAL ); - - glcanvas.swapBuffers(); - glcontext.release(); - - // advance time so the data changes for the next frame - datasource.incrementTime( sdTimeStep ); - - calculateAndShowFPS(); - } - } - }); - } - - //============================================================================== - /** - * Sets up an orthogonal projection suitable for a 2D CAD program. - * - * @param gl2 GL object to set transforms and viewport on. - */ - protected void setTransformsAndViewport( GL2 gl2 ) { - - Rectangle rectangle = glcanvas.getClientArea(); - int iWidth = rectangle.width; - int iHeight = Math.max( rectangle.height, 1 ); - - gl2.glMatrixMode( GLMatrixFunc.GL_PROJECTION ); - gl2.glLoadIdentity(); - - // set the clipping planes based on the ratio of object units - // to screen pixels, but preserving the correct aspect ratio - GLU glu = new GLU(); - glu.gluOrtho2D( -(sfObjectUnitsPerPixel * iWidth) / 2.0f, - (sfObjectUnitsPerPixel * iWidth) / 2.0f, - -(sfObjectUnitsPerPixel * iHeight) / 2.0f, - (sfObjectUnitsPerPixel * iHeight) / 2.0f ); - - gl2.glMatrixMode( GLMatrixFunc.GL_MODELVIEW ); - gl2.glViewport( 0, 0, iWidth, iHeight ); - gl2.glLoadIdentity(); - gl2.glTranslatef( fViewTranslateX, fViewTranslateY, 0.0f ); - } - - //============================================================================== - /** - * Creates vertex buffer object used to store vertices and colors - * (if it doesn't exist). Fills the object with the latest - * vertices and colors from the data store. - * - * @param gl2 GL object used to access all GL functions. - * @param listDataObjects Data objects to get vertices from. - * @return the number of vertices in each of the buffers. - */ - protected int [] createAndFillVertexBuffer( GL2 gl2, List listDataObjects ) { - - int [] aiNumOfVertices = new int [] {listDataObjects.size() * 4}; - - // create vertex buffer object if needed - if( aiVertexBufferIndices[0] == -1 ) { - // check for VBO support - if( !gl2.isFunctionAvailable( "glGenBuffers" ) - || !gl2.isFunctionAvailable( "glBindBuffer" ) - || !gl2.isFunctionAvailable( "glBufferData" ) - || !gl2.isFunctionAvailable( "glDeleteBuffers" ) ) { - Activator.openError( "Error", "Vertex buffer objects not supported." ); - } - - gl2.glGenBuffers( 1, aiVertexBufferIndices, 0 ); - - // create vertex buffer data store without initial copy - gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); - gl2.glBufferData( GL.GL_ARRAY_BUFFER, - aiNumOfVertices[0] * 3 * Buffers.SIZEOF_FLOAT * 2, - null, - GL2.GL_DYNAMIC_DRAW ); - } - - // map the buffer and write vertex and color data directly into it - gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); - ByteBuffer bytebuffer = gl2.glMapBuffer( GL.GL_ARRAY_BUFFER, GL2.GL_WRITE_ONLY ); - FloatBuffer floatbuffer = bytebuffer.order( ByteOrder.nativeOrder() ).asFloatBuffer(); - - for( DataObject dataobject : listDataObjects ) - storeVerticesAndColors( floatbuffer, dataobject ); - - gl2.glUnmapBuffer( GL.GL_ARRAY_BUFFER ); - - return( aiNumOfVertices ); - } - - //============================================================================== - /** - * Stores the vertices and colors of one object interleaved into - * a buffer (vertices in counterclockwise order). - * @param floatbuffer Buffer to store vertices and colors in. - * @param dataobject Object whose vertices and colors are stored. - */ - protected void storeVerticesAndColors( FloatBuffer floatbuffer, DataObject dataobject ) { - - floatbuffer.put( dataobject.getX() ); - floatbuffer.put( dataobject.getY() ); - floatbuffer.put( 0.0f ); - - floatbuffer.put( dataobject.getColor()[0] ); - floatbuffer.put( dataobject.getColor()[1] ); - floatbuffer.put( dataobject.getColor()[2] ); - - floatbuffer.put( dataobject.getX() + dataobject.getWidth() ); - floatbuffer.put( dataobject.getY() ); - floatbuffer.put( 0.0f ); - - floatbuffer.put( dataobject.getColor()[0] ); - floatbuffer.put( dataobject.getColor()[1] ); - floatbuffer.put( dataobject.getColor()[2] ); - - floatbuffer.put( dataobject.getX() + dataobject.getWidth() ); - floatbuffer.put( dataobject.getY() + dataobject.getHeight() ); - floatbuffer.put( 0.0f ); - - floatbuffer.put( dataobject.getColor()[0] ); - floatbuffer.put( dataobject.getColor()[1] ); - floatbuffer.put( dataobject.getColor()[2] ); - - floatbuffer.put( dataobject.getX() ); - floatbuffer.put( dataobject.getY() + dataobject.getHeight() ); - floatbuffer.put( 0.0f ); - - floatbuffer.put( dataobject.getColor()[0] ); - floatbuffer.put( dataobject.getColor()[1] ); - floatbuffer.put( dataobject.getColor()[2] ); - } - - //============================================================================== - /** - * Deletes the vertex and color buffers. - */ - protected void disposeVertexBuffers() { - glcontext.makeCurrent(); - GL2 gl2 = glcontext.getGL().getGL2(); - gl2.glDeleteBuffers( 1, aiVertexBufferIndices, 0 ); - aiVertexBufferIndices[0] = -1; - glcontext.release(); - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public void setFocus() { - } -} +package name.wadewalker.tutorial.jogleditor; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.List; + +import javax.media.opengl.GL; +import javax.media.opengl.GL2; +import javax.media.opengl.GL2ES1; +import javax.media.opengl.GLContext; +import javax.media.opengl.GLDrawableFactory; +import javax.media.opengl.GLProfile; +import javax.media.opengl.fixedfunc.GLMatrixFunc; +import javax.media.opengl.glu.GLU; + +import com.jogamp.common.nio.Buffers; + +import name.wadewalker.tutorial.Activator; +import name.wadewalker.tutorial.DataSource; +import name.wadewalker.tutorial.DataSource.DataObject; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.bindings.keys.ParseException; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.opengl.GLCanvas; +import org.eclipse.swt.opengl.GLData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.EditorPart; + +//============================================================================== +/** + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * @author Wade Walker + */ +public class JOGLEditor extends EditorPart { + + /** Workbench uses this ID to refer to instances of this type of editor. */ + public static final String ssID = "name.wadewalker.tutorial.jogleditor"; + + /** Constant used in FPS calculation. */ + protected static final long slMillisecondsPerSecond = 1000; + + /** Ratio of world-space units to screen pixels. + * Increasing this zooms the display out, + * decreasing it zooms the display in. */ + protected static final float sfObjectUnitsPerPixel = 0.03f; + + /** Amount to increment time on each sim step. */ + protected static final double sdTimeStep = 0.005; + + /** Milliseconds to sleep in each render cycle. */ + protected static final int siSleepPerStepMS = 1; + + /** Holds the OpenGL canvas. */ + protected Composite composite; + + /** Widget that displays OpenGL content. */ + protected GLCanvas glcanvas; + + /** Used to get OpenGL object that we need to access OpenGL functions. */ + protected GLContext glcontext; + + /** Source of data to draw. */ + protected DataSource datasource; + + /** X distance to translate the viewport by. */ + protected float fViewTranslateX; + + /** Y distance to translate the viewport by. */ + protected float fViewTranslateY; + + /** Index of vertex buffer object. We store interleaved vertex and color data here + * like this: x0, r0, y0, g0, z0, b0, x1, r1, y1, g1, z1, b1... + * Stored in an array because glGenBuffers requires it. */ + protected int [] aiVertexBufferIndices = new int [] {-1}; + + /** Number of frames drawn since last FPS calculation. */ + protected int iFPSFrames; + + /** Time in milliseconds at start of FPS calculation interval. */ + protected long lFPSIntervalStartTimeMS; + + //============================================================================== + /** + * Constructor. + */ + public JOGLEditor() { + datasource = new DataSource(); + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public void doSave( IProgressMonitor iprogressmonitor ) { + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public void doSaveAs() { + } + + //============================================================================== + /** + *

Sets up key action handlers.

+ * {@inheritDoc} + */ + @Override + public void init( IEditorSite ieditorsite, IEditorInput ieditorinput ) throws PartInitException { + + setSite( ieditorsite ); + if( ieditorinput != null ) + setInput( ieditorinput ); + + // create action handlers + try { + Activator.createKeyBinding( + new IAction [] { + ieditorsite.getActionBars().getGlobalActionHandler( RunPauseAction.ssID ), + }, + new String [] { + "Space", + }, + getSite() ); + } + catch( ParseException parseexception ) { + throw new PartInitException( parseexception.getMessage() ); + } + catch( IOException ioexception ) { + throw new PartInitException( ioexception.getMessage() ); + } + } + + //============================================================================== + /** + * Disposes all OpenGL resources in case this view is closed and reopened. + * @see org.eclipse.ui.part.WorkbenchPart#dispose() + */ + @Override + public void dispose() { + disposeVertexBuffers(); + glcanvas.dispose(); + super.dispose(); + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public boolean isDirty() { + return false; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public boolean isSaveAsAllowed() { + return false; + } + + //============================================================================== + /** + *

Sets up an OpenGL canvas to draw in.

+ * {@inheritDoc} + */ + @Override + public void createPartControl( Composite compositeParent ) { + GLProfile glprofile = GLProfile.get( GLProfile.GL2 ); + + composite = new Composite( compositeParent, SWT.NONE ); + composite.setLayout( new FillLayout() ); + + GLData gldata = new GLData(); + gldata.doubleBuffer = true; + glcanvas = new GLCanvas( composite, SWT.NO_BACKGROUND, gldata ); + glcanvas.setCurrent(); + glcontext = GLDrawableFactory.getFactory( glprofile ).createExternalGLContext(); + + glcanvas.addListener( SWT.Resize, new Listener() { + public void handleEvent( Event event ) { + glcanvas.setCurrent(); + glcontext.makeCurrent(); + GL2 gl2 = glcontext.getGL().getGL2(); + setTransformsAndViewport( gl2 ); + glcontext.release(); + } + }); + + glcontext.makeCurrent(); + GL2 gl2 = glcontext.getGL().getGL2(); + gl2.setSwapInterval( 1 ); + gl2.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); + gl2.glColor3f( 1.0f, 0.0f, 0.0f ); + gl2.glHint( GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST ); + gl2.glClearDepth( 1.0 ); + gl2.glLineWidth( 2 ); + gl2.glEnable( GL.GL_DEPTH_TEST ); + glcontext.release(); + + // spawn a worker thread to call the renderer in a loop until the program closes. + (new Thread() { + public void run() { + + // look at the run/pause button state to see whether we should be running or not + RunPauseAction runpauseaction = (RunPauseAction)getEditorSite().getActionBars().getGlobalActionHandler( RunPauseAction.ssID ); + + // render once to get it on screen (we start out paused) + render(); + + try { + while( (glcanvas != null) && !glcanvas.isDisposed() ) { + // if we're running, render in the GUI thread + if( runpauseaction.isRunning() ) + render(); + // else we're paused, so sleep for a little so we don't peg the CPU + else + sleep( siSleepPerStepMS ); + } + } + catch( InterruptedException interruptedexception ) { + // if sleep interrupted just let the thread quite + } + } + }).start(); + } + + //============================================================================== + /** + * Calculates the FPS and shows it in the status line. + */ + protected void calculateAndShowFPS() { + ++iFPSFrames; + long lTime = System.currentTimeMillis(); + // update the FPS (once per second at most, to avoid flooding + // the UI with text updates) + long lTimeIntervalMS = lTime - lFPSIntervalStartTimeMS; + if( lTimeIntervalMS >= slMillisecondsPerSecond ) { + lFPSIntervalStartTimeMS = lTime; + int iFPS = (int)((double)(iFPSFrames * slMillisecondsPerSecond) / (double)lTimeIntervalMS); + iFPSFrames = 0; + getEditorSite().getActionBars().getStatusLineManager().setMessage( String.format( "FPS: %d", iFPS ) ); + } + } + + //============================================================================== + /** + * Renders into the GUI thread synchronously. Meant to be called + * from a worker thread. + */ + private void render() { + + PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable() { + public void run() { + if( (glcanvas != null) && !glcanvas.isDisposed() ) { + glcanvas.setCurrent(); + glcontext.makeCurrent(); + GL2 gl2 = glcontext.getGL().getGL2(); + gl2.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ); + gl2.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); + + // create vertex buffers if needed, then copy data in + int [] aiNumOfVertices = createAndFillVertexBuffer( gl2, datasource.getData() ); + + // needed so material for quads will be set from color map + gl2.glColorMaterial( GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE ); + gl2.glEnable( GL2.GL_COLOR_MATERIAL ); + + // draw all quads in vertex buffer + gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); + gl2.glEnableClientState( GL2.GL_VERTEX_ARRAY ); + gl2.glEnableClientState( GL2.GL_COLOR_ARRAY ); + gl2.glVertexPointer( 3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 0 ); + gl2.glColorPointer( 3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 3 * Buffers.SIZEOF_FLOAT ); + gl2.glPolygonMode( GL.GL_FRONT, GL2.GL_FILL ); + gl2.glDrawArrays( GL2.GL_QUADS, 0, aiNumOfVertices[0] ); + + // disable arrays once we're done + gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, 0 ); + gl2.glDisableClientState( GL2.GL_VERTEX_ARRAY ); + gl2.glDisableClientState( GL2.GL_COLOR_ARRAY ); + gl2.glDisable( GL2.GL_COLOR_MATERIAL ); + + glcanvas.swapBuffers(); + glcontext.release(); + + // advance time so the data changes for the next frame + datasource.incrementTime( sdTimeStep ); + + calculateAndShowFPS(); + } + } + }); + } + + //============================================================================== + /** + * Sets up an orthogonal projection suitable for a 2D CAD program. + * + * @param gl2 GL object to set transforms and viewport on. + */ + protected void setTransformsAndViewport( GL2 gl2 ) { + + Rectangle rectangle = glcanvas.getClientArea(); + int iWidth = rectangle.width; + int iHeight = Math.max( rectangle.height, 1 ); + + gl2.glMatrixMode( GLMatrixFunc.GL_PROJECTION ); + gl2.glLoadIdentity(); + + // set the clipping planes based on the ratio of object units + // to screen pixels, but preserving the correct aspect ratio + GLU glu = new GLU(); + glu.gluOrtho2D( -(sfObjectUnitsPerPixel * iWidth) / 2.0f, + (sfObjectUnitsPerPixel * iWidth) / 2.0f, + -(sfObjectUnitsPerPixel * iHeight) / 2.0f, + (sfObjectUnitsPerPixel * iHeight) / 2.0f ); + + gl2.glMatrixMode( GLMatrixFunc.GL_MODELVIEW ); + gl2.glViewport( 0, 0, iWidth, iHeight ); + gl2.glLoadIdentity(); + gl2.glTranslatef( fViewTranslateX, fViewTranslateY, 0.0f ); + } + + //============================================================================== + /** + * Creates vertex buffer object used to store vertices and colors + * (if it doesn't exist). Fills the object with the latest + * vertices and colors from the data store. + * + * @param gl2 GL object used to access all GL functions. + * @param listDataObjects Data objects to get vertices from. + * @return the number of vertices in each of the buffers. + */ + protected int [] createAndFillVertexBuffer( GL2 gl2, List listDataObjects ) { + + int [] aiNumOfVertices = new int [] {listDataObjects.size() * 4}; + + // create vertex buffer object if needed + if( aiVertexBufferIndices[0] == -1 ) { + // check for VBO support + if( !gl2.isFunctionAvailable( "glGenBuffers" ) + || !gl2.isFunctionAvailable( "glBindBuffer" ) + || !gl2.isFunctionAvailable( "glBufferData" ) + || !gl2.isFunctionAvailable( "glDeleteBuffers" ) ) { + Activator.openError( "Error", "Vertex buffer objects not supported." ); + } + + gl2.glGenBuffers( 1, aiVertexBufferIndices, 0 ); + + // create vertex buffer data store without initial copy + gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); + gl2.glBufferData( GL.GL_ARRAY_BUFFER, + aiNumOfVertices[0] * 3 * Buffers.SIZEOF_FLOAT * 2, + null, + GL2.GL_DYNAMIC_DRAW ); + } + + // map the buffer and write vertex and color data directly into it + gl2.glBindBuffer( GL.GL_ARRAY_BUFFER, aiVertexBufferIndices[0] ); + ByteBuffer bytebuffer = gl2.glMapBuffer( GL.GL_ARRAY_BUFFER, GL2.GL_WRITE_ONLY ); + FloatBuffer floatbuffer = bytebuffer.order( ByteOrder.nativeOrder() ).asFloatBuffer(); + + for( DataObject dataobject : listDataObjects ) + storeVerticesAndColors( floatbuffer, dataobject ); + + gl2.glUnmapBuffer( GL.GL_ARRAY_BUFFER ); + + return( aiNumOfVertices ); + } + + //============================================================================== + /** + * Stores the vertices and colors of one object interleaved into + * a buffer (vertices in counterclockwise order). + * @param floatbuffer Buffer to store vertices and colors in. + * @param dataobject Object whose vertices and colors are stored. + */ + protected void storeVerticesAndColors( FloatBuffer floatbuffer, DataObject dataobject ) { + + floatbuffer.put( dataobject.getX() ); + floatbuffer.put( dataobject.getY() ); + floatbuffer.put( 0.0f ); + + floatbuffer.put( dataobject.getColor()[0] ); + floatbuffer.put( dataobject.getColor()[1] ); + floatbuffer.put( dataobject.getColor()[2] ); + + floatbuffer.put( dataobject.getX() + dataobject.getWidth() ); + floatbuffer.put( dataobject.getY() ); + floatbuffer.put( 0.0f ); + + floatbuffer.put( dataobject.getColor()[0] ); + floatbuffer.put( dataobject.getColor()[1] ); + floatbuffer.put( dataobject.getColor()[2] ); + + floatbuffer.put( dataobject.getX() + dataobject.getWidth() ); + floatbuffer.put( dataobject.getY() + dataobject.getHeight() ); + floatbuffer.put( 0.0f ); + + floatbuffer.put( dataobject.getColor()[0] ); + floatbuffer.put( dataobject.getColor()[1] ); + floatbuffer.put( dataobject.getColor()[2] ); + + floatbuffer.put( dataobject.getX() ); + floatbuffer.put( dataobject.getY() + dataobject.getHeight() ); + floatbuffer.put( 0.0f ); + + floatbuffer.put( dataobject.getColor()[0] ); + floatbuffer.put( dataobject.getColor()[1] ); + floatbuffer.put( dataobject.getColor()[2] ); + } + + //============================================================================== + /** + * Deletes the vertex and color buffers. + */ + protected void disposeVertexBuffers() { + glcontext.makeCurrent(); + GL2 gl2 = glcontext.getGL().getGL2(); + gl2.glDeleteBuffers( 1, aiVertexBufferIndices, 0 ); + aiVertexBufferIndices[0] = -1; + glcontext.release(); + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public void setFocus() { + } +} diff --git a/src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java similarity index 97% rename from src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java rename to tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java index 69e206e..d45fe03 100644 --- a/src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorActionBarContributor.java @@ -1,55 +1,55 @@ -package name.wadewalker.tutorial.jogleditor; - -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.part.EditorActionBarContributor; - -//============================================================================== -/** - * Contributes the JOGLEditor's actions to the action bar. - * - * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. - * @author Wade Walker - */ -public class JOGLEditorActionBarContributor extends EditorActionBarContributor { - - /** Runs and pauses the simulation. */ - private RunPauseAction runpauseaction; - - //============================================================================== - /** - * Constructor. Creates the actions. - */ - public JOGLEditorActionBarContributor() { - runpauseaction = new RunPauseAction(); - } - - //============================================================================== - /** - * Registers action handlers. - * - * @param iactionbars Used to register global actions. - * @param iworkbenchpage Used to set part listeners. - * @see org.eclipse.ui.part.EditorActionBarContributor#init(org.eclipse.ui.IActionBars, org.eclipse.ui.IWorkbenchPage) - */ - @Override - public void init( IActionBars iactionbars, IWorkbenchPage iworkbenchpage ) { - super.init( iactionbars, iworkbenchpage ); - - // register handlers - iactionbars.setGlobalActionHandler( RunPauseAction.ssID, runpauseaction ); - } - - //============================================================================== - /** - * Contributes the editor's actions to the tool bar. - * - * @param itoolbarmanager Used to add actions to the editor tool bar. - * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager) - */ - @Override - public void contributeToToolBar( IToolBarManager itoolbarmanager ) { - itoolbarmanager.add( runpauseaction ); - } -} +package name.wadewalker.tutorial.jogleditor; + +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.part.EditorActionBarContributor; + +//============================================================================== +/** + * Contributes the JOGLEditor's actions to the action bar. + * + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * @author Wade Walker + */ +public class JOGLEditorActionBarContributor extends EditorActionBarContributor { + + /** Runs and pauses the simulation. */ + private RunPauseAction runpauseaction; + + //============================================================================== + /** + * Constructor. Creates the actions. + */ + public JOGLEditorActionBarContributor() { + runpauseaction = new RunPauseAction(); + } + + //============================================================================== + /** + * Registers action handlers. + * + * @param iactionbars Used to register global actions. + * @param iworkbenchpage Used to set part listeners. + * @see org.eclipse.ui.part.EditorActionBarContributor#init(org.eclipse.ui.IActionBars, org.eclipse.ui.IWorkbenchPage) + */ + @Override + public void init( IActionBars iactionbars, IWorkbenchPage iworkbenchpage ) { + super.init( iactionbars, iworkbenchpage ); + + // register handlers + iactionbars.setGlobalActionHandler( RunPauseAction.ssID, runpauseaction ); + } + + //============================================================================== + /** + * Contributes the editor's actions to the tool bar. + * + * @param itoolbarmanager Used to add actions to the editor tool bar. + * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager) + */ + @Override + public void contributeToToolBar( IToolBarManager itoolbarmanager ) { + itoolbarmanager.add( runpauseaction ); + } +} diff --git a/src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java similarity index 96% rename from src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java rename to tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java index 1b68caa..33bc1ed 100644 --- a/src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/JOGLEditorInput.java @@ -1,80 +1,80 @@ -package name.wadewalker.tutorial.jogleditor; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IPersistableElement; - -//============================================================================== -/** - * Editor input object for the JOGL editor. Currently these editors - * aren't associated with any files, but eventually they will be. - * - * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. - * @author Wade Walker - */ -public class JOGLEditorInput implements IEditorInput { - - //============================================================================== - /** - * Returns an object which is an instance of the given class - * associated with this object. Returns null if no such object can - * be found. - * - * @param classAdapter the adapter class to look up. - * @return an object castable to the given class, or null if this - * object does not have an adapter for the given class. - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - @SuppressWarnings("rawtypes") - public Object getAdapter( Class classAdapter ) { - if( classAdapter.equals( JOGLEditorInput.class ) ) - return this; - - return null; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public boolean exists() { - return true; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public ImageDescriptor getImageDescriptor() { - return null; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "JOGLEditor"; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public IPersistableElement getPersistable() { - return null; - } - - //============================================================================== - /** - * {@inheritDoc} - */ - @Override - public String getToolTipText() { - return "Editor that uses JOGL"; - } -} +package name.wadewalker.tutorial.jogleditor; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; + +//============================================================================== +/** + * Editor input object for the JOGL editor. Currently these editors + * aren't associated with any files, but eventually they will be. + * + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * @author Wade Walker + */ +public class JOGLEditorInput implements IEditorInput { + + //============================================================================== + /** + * Returns an object which is an instance of the given class + * associated with this object. Returns null if no such object can + * be found. + * + * @param classAdapter the adapter class to look up. + * @return an object castable to the given class, or null if this + * object does not have an adapter for the given class. + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @SuppressWarnings("rawtypes") + public Object getAdapter( Class classAdapter ) { + if( classAdapter.equals( JOGLEditorInput.class ) ) + return this; + + return null; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public boolean exists() { + return true; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public ImageDescriptor getImageDescriptor() { + return null; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "JOGLEditor"; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public IPersistableElement getPersistable() { + return null; + } + + //============================================================================== + /** + * {@inheritDoc} + */ + @Override + public String getToolTipText() { + return "Editor that uses JOGL"; + } +} diff --git a/src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java similarity index 96% rename from src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java rename to tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java index e223bcf..eeb45a3 100644 --- a/src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java +++ b/tutorial-plugin/src/name/wadewalker/tutorial/jogleditor/RunPauseAction.java @@ -1,62 +1,62 @@ -package name.wadewalker.tutorial.jogleditor; - -import name.wadewalker.tutorial.Activator; - -import org.eclipse.jface.action.Action; - -//============================================================================== -/** - * Runs or pauses the simulation on alternate button presses. - * Changes the picture and tooltip of the button accordingly. - * - * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. - * @author Wade Walker - */ -public class RunPauseAction extends Action { - - /** Unique action ID for the Eclipse platform. */ - public static final String ssID = "JOGLEditor.RunPauseAction"; - - /** True if the simulation is running, false if it's paused. */ - private boolean bRunning; - - //============================================================================== - /** - * Constructor. - */ - public RunPauseAction() { - super( "Run", Action.AS_PUSH_BUTTON ); - setToolTipText( "Run simulation" ); - setImageDescriptor( Activator.getIcon( "jogleditor/resume_co.gif" ) ); - setId( ssID ); - setActionDefinitionId( ssID ); - } - - //============================================================================== - /** - * Code to run the action. - * - * @see org.eclipse.jface.action.Action#run() - */ - @Override - public void run() { - if( bRunning ) { - setToolTipText( "Run simulation" ); - setImageDescriptor( Activator.getIcon( "jogleditor/resume_co.gif" ) ); - } - else { - setToolTipText( "Pause simulation" ); - setImageDescriptor( Activator.getIcon( "jogleditor/suspend_co.gif" ) ); - } - bRunning = !bRunning; - } - - //============================================================================== - /** - * Accessor. - * @return true if the simulation is running, false otherwise. - */ - public boolean isRunning() { - return( bRunning ); - } -} +package name.wadewalker.tutorial.jogleditor; + +import name.wadewalker.tutorial.Activator; + +import org.eclipse.jface.action.Action; + +//============================================================================== +/** + * Runs or pauses the simulation on alternate button presses. + * Changes the picture and tooltip of the button accordingly. + * + * Copyright (c) 2010-2011 Wade Walker. Free for any use, but credit is appreciated. + * @author Wade Walker + */ +public class RunPauseAction extends Action { + + /** Unique action ID for the Eclipse platform. */ + public static final String ssID = "JOGLEditor.RunPauseAction"; + + /** True if the simulation is running, false if it's paused. */ + private boolean bRunning; + + //============================================================================== + /** + * Constructor. + */ + public RunPauseAction() { + super( "Run", Action.AS_PUSH_BUTTON ); + setToolTipText( "Run simulation" ); + setImageDescriptor( Activator.getIcon( "jogleditor/resume_co.gif" ) ); + setId( ssID ); + setActionDefinitionId( ssID ); + } + + //============================================================================== + /** + * Code to run the action. + * + * @see org.eclipse.jface.action.Action#run() + */ + @Override + public void run() { + if( bRunning ) { + setToolTipText( "Run simulation" ); + setImageDescriptor( Activator.getIcon( "jogleditor/resume_co.gif" ) ); + } + else { + setToolTipText( "Pause simulation" ); + setImageDescriptor( Activator.getIcon( "jogleditor/suspend_co.gif" ) ); + } + bRunning = !bRunning; + } + + //============================================================================== + /** + * Accessor. + * @return true if the simulation is running, false otherwise. + */ + public boolean isRunning() { + return( bRunning ); + } +} diff --git a/tutorial-product/.classpath b/tutorial-product/.classpath new file mode 100755 index 0000000..464509f --- /dev/null +++ b/tutorial-product/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/tutorial-product/.project b/tutorial-product/.project new file mode 100755 index 0000000..1ee6bb4 --- /dev/null +++ b/tutorial-product/.project @@ -0,0 +1,23 @@ + + + tutorial-product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/tutorial-product/.settings/org.eclipse.jdt.core.prefs b/tutorial-product/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 0000000..4ede96d --- /dev/null +++ b/tutorial-product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning diff --git a/tutorial-product/.settings/org.eclipse.m2e.core.prefs b/tutorial-product/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 0000000..f897a7f --- /dev/null +++ b/tutorial-product/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/Tutorial.product b/tutorial-product/Tutorial.product old mode 100644 new mode 100755 similarity index 80% rename from Tutorial.product rename to tutorial-product/Tutorial.product index 3ab1d6a..b264bce --- a/Tutorial.product +++ b/tutorial-product/Tutorial.product @@ -1,18 +1,21 @@ - + + - -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Djava.awt.headless=true + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts - + + @@ -20,16 +23,17 @@ + + + - - @@ -80,7 +84,6 @@ - @@ -89,7 +92,14 @@ + + + + + + + diff --git a/tutorial-product/fix-mod.sh b/tutorial-product/fix-mod.sh new file mode 100755 index 0000000..1e98a52 --- /dev/null +++ b/tutorial-product/fix-mod.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +readonly SELF=$(cd $(dirname $0) && pwd) +readonly productPath="${SELF}/target/products" +readonly productZip=name.wadewalker.tutorial.product-win32.win32.x86_64.zip +readonly installDir="${productPath}/Tutorial" + +unzip -q "${productPath}/${productZip}" -d "${installDir}" + +# Make things executable that Tycho goofs up +chmod a+x "${installDir}/Tutorial.exe" +find "${installDir}/plugins" -print0 -name '*.dll' | xargs --null chmod a+x + # chmod a+x $(find "${installDir}/plugins" -name '*.dll') + diff --git a/tutorial-product/pom.xml b/tutorial-product/pom.xml new file mode 100755 index 0000000..dfe9c85 --- /dev/null +++ b/tutorial-product/pom.xml @@ -0,0 +1,50 @@ + + 4.0.0 + + + name.wadewalker.tutorial + tutorial-parent + 1.0.0-SNAPSHOT + ../tutorial-parent + + + tutorial-product + eclipse-repository + + JOGL Eclipse Tutorial Product + JOGL Eclipse tutorial product + + + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho.version} + + + materialize-products + + materialize-products + + + + archive-products + + archive-products + + + + + + + + + + name.wadewalker.tutorial + tutorial-plugin + 1.0.0-SNAPSHOT + + + +