diff --git a/.gitignore b/.gitignore index 04ab97c3..890dbad1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -*.class - +*.bak bin .metadata .recommenders @@ -9,3 +8,5 @@ bin *.war *.ear TeachingKidsProgramming/.virtual_proctor.txt +*.iml +.idea diff --git a/Ninite Eclipse Installer.exe b/Ninite Eclipse Installer.exe deleted file mode 100644 index 9f821b25..00000000 Binary files a/Ninite Eclipse Installer.exe and /dev/null differ diff --git a/Ninite JDK Installer.exe b/Ninite JDK Installer.exe deleted file mode 100644 index 7749d331..00000000 Binary files a/Ninite JDK Installer.exe and /dev/null differ diff --git a/README.md b/README.md index 0dd1e2a1..b5e4463d 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,9 @@ -##Set up TKPJava courseware and customized Eclipse## - -1a) **Create** a new folder named **TKPSource** (no spaces in the folder name) at C:\ -> C:\TKPSource. - -1b) **Download** the TKP zip file from this site. Download this zip file by clicking the 'Download ZIP' button on the middle right side of this page (or use the link directly below this line). Wait for the download to complete. - -[![download zip button][2]][1] - -1c) **Move** the zip file from your **\Downloads** folder to the **C:\TKPSource** folder. The name of the downloaded file is 'TeachingkidsProgramming.Java-master.zip'. - -1d) **Unzip** the downloaded file (by right clicking it) and then click on 'extract all'(Win) or 'unzip'(Mac) to unzip it. - -1e) **Open** the unzipped TKP folders and find the **'TKP_Launcher.jar'** file. - -1f) **Run** the 'TKP_Launcher.jar file by double-clicking it. Wait for it to run. - - If the jar file runs ok, then Eclipse will launch with the TKP workspace open. - - If an error MessageBox pops up, read the message and go to - the 'Fixing Installation Errors' section at the bottom of this document. - -A successful install should look like the screenshot below: (you can test with two lines of code below) - - Tortoise.show(); - -![screenshot of Eclipse](http://teachingkidsprogramming.org/blog/wp-content/uploads/2012/04/Screen-shot-TKP-Java1.png) ============================= ## Lesson Plans ## #####You can download [Printable Lesson Plans] (https://www.penflip.com/lynnlangit/tkp-lesson-plans) to aid in teaching. We suggest the PDF format (Indexed and formatted better). These lesson plans include links to our [YouTube channel](https://www.youtube.com/user/tkpjava) which has screencast videos us coding the TKP lessons as well.##### -============================= -### Fixing Installation Errors ### - -If the standard install doesn't work, then there are a couple of possible reasons: - - a) **Java (6 or higher) not installed** -> (for Windows) run the 'Ninite JDK Installer'. After the installer finishes, then double-click on the 'TKP_Launcher.jar' file to re-run it. (for Mac) download the JDK and install it. - - b1) **Eclipse Luna not installed** -> (for Windows) run the 'Ninite Eclipse Installer'. After the installer finishes, then double-click on the 'TKP_Launcher.jar' file to re-run it. - - b2) **Eclipse Luna not installed** -> (for Mac) install Eclipse manually. Be sure to unzip Eclipse into your applications folder. After you are done installing Eclipse, then double-click on the 'TKP_Launcher.jar' file to re-run it. You may need to 'point to' the TKP workspace manually, see instruction c1b) (below) - - c1a) Some **old version of Eclipse installed** -> (Win/Mac) Delete the version of Eclipse you have on your system by finding the folder named Eclipse and deleting it. Then install Eclipse Luna. You can find Eclipse Luna here - -[Eclipse Luna](https://projects.eclipse.org/releases/luna) - - c1b) Customized **TKP workspace not open** in Eclipse. Open Eclipse and change the default workspace directory, - by clicking on 'File>Switch Workspace>Open...' and navigating to the **\TeachingKidsProgramming.Java** folder. - - After you do this, then your working directory should include the following folders: - ` - \.metadata & \TeachingKidsProgramming` - - - d) General Installation Failure due to **Unable to write to file system location(s)** -> some school districts apply various 'locking' permissions to student computer lab laptops. Try to 'run as administrator' (for Windows) or 'run as root' (for Mac) so that the downloaded TKP files can be unzipped. Another variation of this locked down state is that some schools create a virtual (and sometimes shared C:\ drive). If this is the case, unzip Eclipse to the C:\ drive and then unzip the TKP.zip to each student's **C:\temp** directory. - [1]: https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Java/archive/master.zip - [2]: https://dl.dropboxusercontent.com/u/41301272/downloadZip.png +### Build +By default all tests may fail. So build step needs to be performed by skipping tests \ No newline at end of file diff --git a/TKP_Launcher.jar b/TKP_Launcher.jar deleted file mode 100644 index 1593c945..00000000 Binary files a/TKP_Launcher.jar and /dev/null differ diff --git a/TeachingKidsProgramming/.classpath b/TeachingKidsProgramming/.classpath deleted file mode 100644 index 4afb75cb..00000000 --- a/TeachingKidsProgramming/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/TeachingKidsProgramming/.project b/TeachingKidsProgramming/.project deleted file mode 100644 index 9d57ee3b..00000000 --- a/TeachingKidsProgramming/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - TeachingKidsProgramming - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/TeachingKidsProgramming/Spiral.jar b/TeachingKidsProgramming/Spiral.jar deleted file mode 100644 index 6170b45f..00000000 Binary files a/TeachingKidsProgramming/Spiral.jar and /dev/null differ diff --git a/TeachingKidsProgramming/build/build.xml b/TeachingKidsProgramming/build/build.xml deleted file mode 100644 index 1e6d749b..00000000 --- a/TeachingKidsProgramming/build/build.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TeachingKidsProgramming/for_loop.xml b/TeachingKidsProgramming/for_loop.xml deleted file mode 100644 index 0ea618cf..00000000 --- a/TeachingKidsProgramming/for_loop.xml +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/TeachingKidsProgramming/spun_code_style.xml b/TeachingKidsProgramming/spun_code_style.xml deleted file mode 100644 index b8fa5515..00000000 --- a/TeachingKidsProgramming/spun_code_style.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TeachingKidsProgramming/src/jars/TeachingKidsProgramming.jar b/TeachingKidsProgramming/src/jars/TeachingKidsProgramming.jar deleted file mode 100644 index e94676df..00000000 Binary files a/TeachingKidsProgramming/src/jars/TeachingKidsProgramming.jar and /dev/null differ diff --git a/build/pom.xml b/build/pom.xml new file mode 100644 index 00000000..4fe4ba3e --- /dev/null +++ b/build/pom.xml @@ -0,0 +1,11 @@ + + + 4.0.0 + + teaching-kids-programming + org.teachingkids.programming + 1.0-SNAPSHOT + + simple-square-lib + TKP :: Build + diff --git a/build/src/main/resources/com/spun/util/ArrayUtils$IterableWrapper.class b/build/src/main/resources/com/spun/util/ArrayUtils$IterableWrapper.class new file mode 100644 index 00000000..c463c0f6 Binary files /dev/null and b/build/src/main/resources/com/spun/util/ArrayUtils$IterableWrapper.class differ diff --git a/build/src/main/resources/com/spun/util/ArrayUtils.class b/build/src/main/resources/com/spun/util/ArrayUtils.class new file mode 100644 index 00000000..23ecfa8f Binary files /dev/null and b/build/src/main/resources/com/spun/util/ArrayUtils.class differ diff --git a/build/src/main/resources/com/spun/util/Asserts.class b/build/src/main/resources/com/spun/util/Asserts.class new file mode 100644 index 00000000..66496aed Binary files /dev/null and b/build/src/main/resources/com/spun/util/Asserts.class differ diff --git a/build/src/main/resources/com/spun/util/ClassUtils.class b/build/src/main/resources/com/spun/util/ClassUtils.class new file mode 100644 index 00000000..61340bea Binary files /dev/null and b/build/src/main/resources/com/spun/util/ClassUtils.class differ diff --git a/build/src/main/resources/com/spun/util/Country.class b/build/src/main/resources/com/spun/util/Country.class new file mode 100644 index 00000000..eebf426b Binary files /dev/null and b/build/src/main/resources/com/spun/util/Country.class differ diff --git a/build/src/main/resources/com/spun/util/DatabaseUtils.class b/build/src/main/resources/com/spun/util/DatabaseUtils.class new file mode 100644 index 00000000..0f1036ef Binary files /dev/null and b/build/src/main/resources/com/spun/util/DatabaseUtils.class differ diff --git a/build/src/main/resources/com/spun/util/DateDifference.class b/build/src/main/resources/com/spun/util/DateDifference.class new file mode 100644 index 00000000..a1fbb267 Binary files /dev/null and b/build/src/main/resources/com/spun/util/DateDifference.class differ diff --git a/build/src/main/resources/com/spun/util/DateUtils.class b/build/src/main/resources/com/spun/util/DateUtils.class new file mode 100644 index 00000000..2cb0fb9d Binary files /dev/null and b/build/src/main/resources/com/spun/util/DateUtils.class differ diff --git a/build/src/main/resources/com/spun/util/DualOutputStream.class b/build/src/main/resources/com/spun/util/DualOutputStream.class new file mode 100644 index 00000000..3c726c60 Binary files /dev/null and b/build/src/main/resources/com/spun/util/DualOutputStream.class differ diff --git a/build/src/main/resources/com/spun/util/FormattedException.class b/build/src/main/resources/com/spun/util/FormattedException.class new file mode 100644 index 00000000..50236ec2 Binary files /dev/null and b/build/src/main/resources/com/spun/util/FormattedException.class differ diff --git a/build/src/main/resources/com/spun/util/FrameCloser.class b/build/src/main/resources/com/spun/util/FrameCloser.class new file mode 100644 index 00000000..987c7be6 Binary files /dev/null and b/build/src/main/resources/com/spun/util/FrameCloser.class differ diff --git a/build/src/main/resources/com/spun/util/LambdaThreadLauncher.class b/build/src/main/resources/com/spun/util/LambdaThreadLauncher.class new file mode 100644 index 00000000..a8b4d2fe Binary files /dev/null and b/build/src/main/resources/com/spun/util/LambdaThreadLauncher.class differ diff --git a/build/src/main/resources/com/spun/util/MethodExecutionPath$MethodParameterFilter.class b/build/src/main/resources/com/spun/util/MethodExecutionPath$MethodParameterFilter.class new file mode 100644 index 00000000..4a9911ee Binary files /dev/null and b/build/src/main/resources/com/spun/util/MethodExecutionPath$MethodParameterFilter.class differ diff --git a/build/src/main/resources/com/spun/util/MethodExecutionPath$Parameters.class b/build/src/main/resources/com/spun/util/MethodExecutionPath$Parameters.class new file mode 100644 index 00000000..9cda7e05 Binary files /dev/null and b/build/src/main/resources/com/spun/util/MethodExecutionPath$Parameters.class differ diff --git a/build/src/main/resources/com/spun/util/MethodExecutionPath.class b/build/src/main/resources/com/spun/util/MethodExecutionPath.class new file mode 100644 index 00000000..c7eb2ad3 Binary files /dev/null and b/build/src/main/resources/com/spun/util/MethodExecutionPath.class differ diff --git a/build/src/main/resources/com/spun/util/MySystem.class b/build/src/main/resources/com/spun/util/MySystem.class new file mode 100644 index 00000000..0f51c759 Binary files /dev/null and b/build/src/main/resources/com/spun/util/MySystem.class differ diff --git a/build/src/main/resources/com/spun/util/NumberUtils$Shuffler.class b/build/src/main/resources/com/spun/util/NumberUtils$Shuffler.class new file mode 100644 index 00000000..c8dc37fd Binary files /dev/null and b/build/src/main/resources/com/spun/util/NumberUtils$Shuffler.class differ diff --git a/build/src/main/resources/com/spun/util/NumberUtils.class b/build/src/main/resources/com/spun/util/NumberUtils.class new file mode 100644 index 00000000..d71cd711 Binary files /dev/null and b/build/src/main/resources/com/spun/util/NumberUtils.class differ diff --git a/build/src/main/resources/com/spun/util/ObjectUtils.class b/build/src/main/resources/com/spun/util/ObjectUtils.class new file mode 100644 index 00000000..0c13e77a Binary files /dev/null and b/build/src/main/resources/com/spun/util/ObjectUtils.class differ diff --git a/build/src/main/resources/com/spun/util/PhoneNumber.class b/build/src/main/resources/com/spun/util/PhoneNumber.class new file mode 100644 index 00000000..8e3c1788 Binary files /dev/null and b/build/src/main/resources/com/spun/util/PhoneNumber.class differ diff --git a/build/src/main/resources/com/spun/util/SearchingFileFilter.class b/build/src/main/resources/com/spun/util/SearchingFileFilter.class new file mode 100644 index 00000000..e217eca8 Binary files /dev/null and b/build/src/main/resources/com/spun/util/SearchingFileFilter.class differ diff --git a/build/src/main/resources/com/spun/util/StringUtils$1.class b/build/src/main/resources/com/spun/util/StringUtils$1.class new file mode 100644 index 00000000..7ba96444 Binary files /dev/null and b/build/src/main/resources/com/spun/util/StringUtils$1.class differ diff --git a/build/src/main/resources/com/spun/util/StringUtils.class b/build/src/main/resources/com/spun/util/StringUtils.class new file mode 100644 index 00000000..5b54fbbf Binary files /dev/null and b/build/src/main/resources/com/spun/util/StringUtils.class differ diff --git a/build/src/main/resources/com/spun/util/SystemUtils.class b/build/src/main/resources/com/spun/util/SystemUtils.class new file mode 100644 index 00000000..bebb038c Binary files /dev/null and b/build/src/main/resources/com/spun/util/SystemUtils.class differ diff --git a/build/src/main/resources/com/spun/util/ThreadLauncher.class b/build/src/main/resources/com/spun/util/ThreadLauncher.class new file mode 100644 index 00000000..b93b278b Binary files /dev/null and b/build/src/main/resources/com/spun/util/ThreadLauncher.class differ diff --git a/build/src/main/resources/com/spun/util/ThreadUtils.class b/build/src/main/resources/com/spun/util/ThreadUtils.class new file mode 100644 index 00000000..2264618c Binary files /dev/null and b/build/src/main/resources/com/spun/util/ThreadUtils.class differ diff --git a/build/src/main/resources/com/spun/util/WindowUtils.class b/build/src/main/resources/com/spun/util/WindowUtils.class new file mode 100644 index 00000000..923bd0d3 Binary files /dev/null and b/build/src/main/resources/com/spun/util/WindowUtils.class differ diff --git a/build/src/main/resources/com/spun/util/database/ColumnMetadata.class b/build/src/main/resources/com/spun/util/database/ColumnMetadata.class new file mode 100644 index 00000000..f3964488 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/ColumnMetadata.class differ diff --git a/build/src/main/resources/com/spun/util/database/DatabaseObject$FilterNew.class b/build/src/main/resources/com/spun/util/database/DatabaseObject$FilterNew.class new file mode 100644 index 00000000..ae5d22f4 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/DatabaseObject$FilterNew.class differ diff --git a/build/src/main/resources/com/spun/util/database/DatabaseObject$Utils.class b/build/src/main/resources/com/spun/util/database/DatabaseObject$Utils.class new file mode 100644 index 00000000..4817c2e9 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/DatabaseObject$Utils.class differ diff --git a/build/src/main/resources/com/spun/util/database/DatabaseObject.class b/build/src/main/resources/com/spun/util/database/DatabaseObject.class new file mode 100644 index 00000000..1249720a Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/DatabaseObject.class differ diff --git a/build/src/main/resources/com/spun/util/database/DatabaseRelationshipPersistent.class b/build/src/main/resources/com/spun/util/database/DatabaseRelationshipPersistent.class new file mode 100644 index 00000000..a830b66c Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/DatabaseRelationshipPersistent.class differ diff --git a/build/src/main/resources/com/spun/util/database/DatabaseTransactionInfo.class b/build/src/main/resources/com/spun/util/database/DatabaseTransactionInfo.class new file mode 100644 index 00000000..a6a956ed Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/DatabaseTransactionInfo.class differ diff --git a/build/src/main/resources/com/spun/util/database/Metadata.class b/build/src/main/resources/com/spun/util/database/Metadata.class new file mode 100644 index 00000000..cba6ed53 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/Metadata.class differ diff --git a/build/src/main/resources/com/spun/util/database/NullDatabaseObject.class b/build/src/main/resources/com/spun/util/database/NullDatabaseObject.class new file mode 100644 index 00000000..9a8590e7 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/NullDatabaseObject.class differ diff --git a/build/src/main/resources/com/spun/util/database/ResultSetWriter.class b/build/src/main/resources/com/spun/util/database/ResultSetWriter.class new file mode 100644 index 00000000..f52b49c6 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/ResultSetWriter.class differ diff --git a/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter$Replacer.class b/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter$Replacer.class new file mode 100644 index 00000000..1a74eae0 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter$Replacer.class differ diff --git a/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter.class b/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter.class new file mode 100644 index 00000000..fb48d893 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/ReverseOrderLimitQueryWriter.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLInformationException$SQL_SERVER_CODES.class b/build/src/main/resources/com/spun/util/database/SQLInformationException$SQL_SERVER_CODES.class new file mode 100644 index 00000000..3a2b011e Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLInformationException$SQL_SERVER_CODES.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLInformationException.class b/build/src/main/resources/com/spun/util/database/SQLInformationException.class new file mode 100644 index 00000000..c3d0240e Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLInformationException.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQuery$FromPart.class b/build/src/main/resources/com/spun/util/database/SQLQuery$FromPart.class new file mode 100644 index 00000000..11eca256 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQuery$FromPart.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQuery$JOINS.class b/build/src/main/resources/com/spun/util/database/SQLQuery$JOINS.class new file mode 100644 index 00000000..c4e6b951 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQuery$JOINS.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQuery$LimitPart.class b/build/src/main/resources/com/spun/util/database/SQLQuery$LimitPart.class new file mode 100644 index 00000000..75a7df86 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQuery$LimitPart.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQuery$OrderByPart.class b/build/src/main/resources/com/spun/util/database/SQLQuery$OrderByPart.class new file mode 100644 index 00000000..55c45283 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQuery$OrderByPart.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQuery.class b/build/src/main/resources/com/spun/util/database/SQLQuery.class new file mode 100644 index 00000000..88b74afb Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQuery.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLQueryWriter.class b/build/src/main/resources/com/spun/util/database/SQLQueryWriter.class new file mode 100644 index 00000000..3a8de4c3 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLQueryWriter.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLStatementUtils.class b/build/src/main/resources/com/spun/util/database/SQLStatementUtils.class new file mode 100644 index 00000000..57d0b563 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLStatementUtils.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLUtils.class b/build/src/main/resources/com/spun/util/database/SQLUtils.class new file mode 100644 index 00000000..7bae523a Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLUtils.class differ diff --git a/build/src/main/resources/com/spun/util/database/SQLWhere.class b/build/src/main/resources/com/spun/util/database/SQLWhere.class new file mode 100644 index 00000000..743cecaf Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SQLWhere.class differ diff --git a/build/src/main/resources/com/spun/util/database/SimpleQueryWriter.class b/build/src/main/resources/com/spun/util/database/SimpleQueryWriter.class new file mode 100644 index 00000000..3e200ed5 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SimpleQueryWriter.class differ diff --git a/build/src/main/resources/com/spun/util/database/SqlConnectionException.class b/build/src/main/resources/com/spun/util/database/SqlConnectionException.class new file mode 100644 index 00000000..61cd0a55 Binary files /dev/null and b/build/src/main/resources/com/spun/util/database/SqlConnectionException.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange$DateRangeFilter.class b/build/src/main/resources/com/spun/util/date/DateRange$DateRangeFilter.class new file mode 100644 index 00000000..cda1d906 Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange$DateRangeFilter.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange$MonthAware.class b/build/src/main/resources/com/spun/util/date/DateRange$MonthAware.class new file mode 100644 index 00000000..ffd65de1 Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange$MonthAware.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange$QuarterAware.class b/build/src/main/resources/com/spun/util/date/DateRange$QuarterAware.class new file mode 100644 index 00000000..1bc2ff85 Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange$QuarterAware.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange$UnitAware.class b/build/src/main/resources/com/spun/util/date/DateRange$UnitAware.class new file mode 100644 index 00000000..30b2414f Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange$UnitAware.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange$WeekAware.class b/build/src/main/resources/com/spun/util/date/DateRange$WeekAware.class new file mode 100644 index 00000000..e2278018 Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange$WeekAware.class differ diff --git a/build/src/main/resources/com/spun/util/date/DateRange.class b/build/src/main/resources/com/spun/util/date/DateRange.class new file mode 100644 index 00000000..c7430f6b Binary files /dev/null and b/build/src/main/resources/com/spun/util/date/DateRange.class differ diff --git a/build/src/main/resources/com/spun/util/filters/Filter.class b/build/src/main/resources/com/spun/util/filters/Filter.class new file mode 100644 index 00000000..694bc5f4 Binary files /dev/null and b/build/src/main/resources/com/spun/util/filters/Filter.class differ diff --git a/build/src/main/resources/com/spun/util/filters/FilterUtils$FilterNotNull.class b/build/src/main/resources/com/spun/util/filters/FilterUtils$FilterNotNull.class new file mode 100644 index 00000000..4ecc04d3 Binary files /dev/null and b/build/src/main/resources/com/spun/util/filters/FilterUtils$FilterNotNull.class differ diff --git a/build/src/main/resources/com/spun/util/filters/FilterUtils.class b/build/src/main/resources/com/spun/util/filters/FilterUtils.class new file mode 100644 index 00000000..00575db2 Binary files /dev/null and b/build/src/main/resources/com/spun/util/filters/FilterUtils.class differ diff --git a/build/src/main/resources/com/spun/util/images/ImageObject.class b/build/src/main/resources/com/spun/util/images/ImageObject.class new file mode 100644 index 00000000..297a7cdf Binary files /dev/null and b/build/src/main/resources/com/spun/util/images/ImageObject.class differ diff --git a/build/src/main/resources/com/spun/util/images/ImageWriter$1.class b/build/src/main/resources/com/spun/util/images/ImageWriter$1.class new file mode 100644 index 00000000..a4c51576 Binary files /dev/null and b/build/src/main/resources/com/spun/util/images/ImageWriter$1.class differ diff --git a/build/src/main/resources/com/spun/util/images/ImageWriter$BufferedImageObject.class b/build/src/main/resources/com/spun/util/images/ImageWriter$BufferedImageObject.class new file mode 100644 index 00000000..0f6c148e Binary files /dev/null and b/build/src/main/resources/com/spun/util/images/ImageWriter$BufferedImageObject.class differ diff --git a/build/src/main/resources/com/spun/util/images/ImageWriter$Encoding.class b/build/src/main/resources/com/spun/util/images/ImageWriter$Encoding.class new file mode 100644 index 00000000..168947dc Binary files /dev/null and b/build/src/main/resources/com/spun/util/images/ImageWriter$Encoding.class differ diff --git a/build/src/main/resources/com/spun/util/images/ImageWriter.class b/build/src/main/resources/com/spun/util/images/ImageWriter.class new file mode 100644 index 00000000..6d54cdee Binary files /dev/null and b/build/src/main/resources/com/spun/util/images/ImageWriter.class differ diff --git a/build/src/main/resources/com/spun/util/io/FileUtils.class b/build/src/main/resources/com/spun/util/io/FileUtils.class new file mode 100644 index 00000000..b315bbb0 Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/FileUtils.class differ diff --git a/build/src/main/resources/com/spun/util/io/SimpleDirectoryFilter.class b/build/src/main/resources/com/spun/util/io/SimpleDirectoryFilter.class new file mode 100644 index 00000000..aa3d6818 Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/SimpleDirectoryFilter.class differ diff --git a/build/src/main/resources/com/spun/util/io/SimpleFileFilter.class b/build/src/main/resources/com/spun/util/io/SimpleFileFilter.class new file mode 100644 index 00000000..968a88b2 Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/SimpleFileFilter.class differ diff --git a/build/src/main/resources/com/spun/util/io/StackElementLevelSelector.class b/build/src/main/resources/com/spun/util/io/StackElementLevelSelector.class new file mode 100644 index 00000000..b8ec0859 Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/StackElementLevelSelector.class differ diff --git a/build/src/main/resources/com/spun/util/io/StackElementSelector.class b/build/src/main/resources/com/spun/util/io/StackElementSelector.class new file mode 100644 index 00000000..94587e5a Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/StackElementSelector.class differ diff --git a/build/src/main/resources/com/spun/util/io/ZipUtils.class b/build/src/main/resources/com/spun/util/io/ZipUtils.class new file mode 100644 index 00000000..8255be11 Binary files /dev/null and b/build/src/main/resources/com/spun/util/io/ZipUtils.class differ diff --git a/build/src/main/resources/com/spun/util/parser/CurrencyAmount.class b/build/src/main/resources/com/spun/util/parser/CurrencyAmount.class new file mode 100644 index 00000000..6fc5a060 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/CurrencyAmount.class differ diff --git a/build/src/main/resources/com/spun/util/parser/ParserCommons.class b/build/src/main/resources/com/spun/util/parser/ParserCommons.class new file mode 100644 index 00000000..12b7b5c0 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/ParserCommons.class differ diff --git a/build/src/main/resources/com/spun/util/parser/PercentageAmount.class b/build/src/main/resources/com/spun/util/parser/PercentageAmount.class new file mode 100644 index 00000000..1a9c926f Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/PercentageAmount.class differ diff --git a/build/src/main/resources/com/spun/util/parser/SteppingIterator.class b/build/src/main/resources/com/spun/util/parser/SteppingIterator.class new file mode 100644 index 00000000..1e7e1aeb Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/SteppingIterator.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateArray$Subsection.class b/build/src/main/resources/com/spun/util/parser/TemplateArray$Subsection.class new file mode 100644 index 00000000..aeface76 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateArray$Subsection.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateArray.class b/build/src/main/resources/com/spun/util/parser/TemplateArray.class new file mode 100644 index 00000000..903212ab Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateArray.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateDate$FORMATS.class b/build/src/main/resources/com/spun/util/parser/TemplateDate$FORMATS.class new file mode 100644 index 00000000..15c4d95f Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateDate$FORMATS.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateDate.class b/build/src/main/resources/com/spun/util/parser/TemplateDate.class new file mode 100644 index 00000000..d2af5f6f Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateDate.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateDouble.class b/build/src/main/resources/com/spun/util/parser/TemplateDouble.class new file mode 100644 index 00000000..711dd9ab Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateDouble.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateNumberUtils.class b/build/src/main/resources/com/spun/util/parser/TemplateNumberUtils.class new file mode 100644 index 00000000..fb937a3c Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateNumberUtils.class differ diff --git a/build/src/main/resources/com/spun/util/parser/TemplateStringUtils.class b/build/src/main/resources/com/spun/util/parser/TemplateStringUtils.class new file mode 100644 index 00000000..fd8142f8 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/TemplateStringUtils.class differ diff --git a/build/src/main/resources/com/spun/util/parser/VelocityList$Item.class b/build/src/main/resources/com/spun/util/parser/VelocityList$Item.class new file mode 100644 index 00000000..d94010b7 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/VelocityList$Item.class differ diff --git a/build/src/main/resources/com/spun/util/parser/VelocityList.class b/build/src/main/resources/com/spun/util/parser/VelocityList.class new file mode 100644 index 00000000..22f77c11 Binary files /dev/null and b/build/src/main/resources/com/spun/util/parser/VelocityList.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/ExecutableQuery.class b/build/src/main/resources/com/spun/util/persistence/ExecutableQuery.class new file mode 100644 index 00000000..2365ac91 Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/ExecutableQuery.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/Loader.class b/build/src/main/resources/com/spun/util/persistence/Loader.class new file mode 100644 index 00000000..259b6fd5 Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/Loader.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/Saver.class b/build/src/main/resources/com/spun/util/persistence/Saver.class new file mode 100644 index 00000000..536a622b Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/Saver.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/SavingException.class b/build/src/main/resources/com/spun/util/persistence/SavingException.class new file mode 100644 index 00000000..0ea1ca4e Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/SavingException.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/SqlLoader$ExecutableWrapper.class b/build/src/main/resources/com/spun/util/persistence/SqlLoader$ExecutableWrapper.class new file mode 100644 index 00000000..24886914 Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/SqlLoader$ExecutableWrapper.class differ diff --git a/build/src/main/resources/com/spun/util/persistence/SqlLoader.class b/build/src/main/resources/com/spun/util/persistence/SqlLoader.class new file mode 100644 index 00000000..17f6cf77 Binary files /dev/null and b/build/src/main/resources/com/spun/util/persistence/SqlLoader.class differ diff --git a/build/src/main/resources/com/spun/util/servlets/ValidationError.class b/build/src/main/resources/com/spun/util/servlets/ValidationError.class new file mode 100644 index 00000000..8f7ffd60 Binary files /dev/null and b/build/src/main/resources/com/spun/util/servlets/ValidationError.class differ diff --git a/build/src/main/resources/com/spun/util/servlets/ValidationTracker.class b/build/src/main/resources/com/spun/util/servlets/ValidationTracker.class new file mode 100644 index 00000000..f2258732 Binary files /dev/null and b/build/src/main/resources/com/spun/util/servlets/ValidationTracker.class differ diff --git a/build/src/main/resources/com/spun/util/tests/StackTraceReflectionResult.class b/build/src/main/resources/com/spun/util/tests/StackTraceReflectionResult.class new file mode 100644 index 00000000..405cf03e Binary files /dev/null and b/build/src/main/resources/com/spun/util/tests/StackTraceReflectionResult.class differ diff --git a/build/src/main/resources/com/spun/util/tests/TestUtils.class b/build/src/main/resources/com/spun/util/tests/TestUtils.class new file mode 100644 index 00000000..126d28d9 Binary files /dev/null and b/build/src/main/resources/com/spun/util/tests/TestUtils.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ContextAware$ContextAwareMap.class b/build/src/main/resources/com/spun/util/velocity/ContextAware$ContextAwareMap.class new file mode 100644 index 00000000..af164dd2 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ContextAware$ContextAwareMap.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ContextAware.class b/build/src/main/resources/com/spun/util/velocity/ContextAware.class new file mode 100644 index 00000000..ebaa40b8 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ContextAware.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParseCall.class b/build/src/main/resources/com/spun/util/velocity/ParseCall.class new file mode 100644 index 00000000..0fab1df5 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParseCall.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$DateValue.class b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$DateValue.class new file mode 100644 index 00000000..9d19212b Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$DateValue.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Day.class b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Day.class new file mode 100644 index 00000000..fff76491 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Day.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Month.class b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Month.class new file mode 100644 index 00000000..aa058dab Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Month.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Year.class b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Year.class new file mode 100644 index 00000000..4d73b481 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils$Year.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/ParserDateUtils.class b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils.class new file mode 100644 index 00000000..2a7c37e5 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/ParserDateUtils.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/StringResourceLoader.class b/build/src/main/resources/com/spun/util/velocity/StringResourceLoader.class new file mode 100644 index 00000000..9cb0e847 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/StringResourceLoader.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelGetterImpl.class b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelGetterImpl.class new file mode 100644 index 00000000..d5eb14ba Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelGetterImpl.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelMethodImpl.class b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelMethodImpl.class new file mode 100644 index 00000000..98ee31a8 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelMethodImpl.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelSetterImpl.class b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelSetterImpl.class new file mode 100644 index 00000000..371b2775 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/TestableUberspect$VelSetterImpl.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/TestableUberspect.class b/build/src/main/resources/com/spun/util/velocity/TestableUberspect.class new file mode 100644 index 00000000..bb24999a Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/TestableUberspect.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/VelocityParser$Default.class b/build/src/main/resources/com/spun/util/velocity/VelocityParser$Default.class new file mode 100644 index 00000000..b9d8fb7d Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/VelocityParser$Default.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/VelocityParser$FileParseCall.class b/build/src/main/resources/com/spun/util/velocity/VelocityParser$FileParseCall.class new file mode 100644 index 00000000..169fb0e2 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/VelocityParser$FileParseCall.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/VelocityParser$JarParseCall.class b/build/src/main/resources/com/spun/util/velocity/VelocityParser$JarParseCall.class new file mode 100644 index 00000000..58bf263a Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/VelocityParser$JarParseCall.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/VelocityParser.class b/build/src/main/resources/com/spun/util/velocity/VelocityParser.class new file mode 100644 index 00000000..f9274e68 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/VelocityParser.class differ diff --git a/build/src/main/resources/com/spun/util/velocity/VelocityParsingError.class b/build/src/main/resources/com/spun/util/velocity/VelocityParsingError.class new file mode 100644 index 00000000..4c9d24e0 Binary files /dev/null and b/build/src/main/resources/com/spun/util/velocity/VelocityParsingError.class differ diff --git a/build/src/main/resources/java/lang/Extendable.class b/build/src/main/resources/java/lang/Extendable.class new file mode 100644 index 00000000..f2e95233 Binary files /dev/null and b/build/src/main/resources/java/lang/Extendable.class differ diff --git a/build/src/main/resources/java/lang/Object.class b/build/src/main/resources/java/lang/Object.class new file mode 100644 index 00000000..d8682632 Binary files /dev/null and b/build/src/main/resources/java/lang/Object.class differ diff --git a/build/src/main/resources/org/approvaltests/Approvals$1.class b/build/src/main/resources/org/approvaltests/Approvals$1.class new file mode 100644 index 00000000..1e3aa60a Binary files /dev/null and b/build/src/main/resources/org/approvaltests/Approvals$1.class differ diff --git a/build/src/main/resources/org/approvaltests/Approvals.class b/build/src/main/resources/org/approvaltests/Approvals.class new file mode 100644 index 00000000..24a58309 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/Approvals.class differ diff --git a/build/src/main/resources/org/approvaltests/ReporterFactory$FileTypes.class b/build/src/main/resources/org/approvaltests/ReporterFactory$FileTypes.class new file mode 100644 index 00000000..72db29af Binary files /dev/null and b/build/src/main/resources/org/approvaltests/ReporterFactory$FileTypes.class differ diff --git a/build/src/main/resources/org/approvaltests/ReporterFactory.class b/build/src/main/resources/org/approvaltests/ReporterFactory.class new file mode 100644 index 00000000..9d85b18b Binary files /dev/null and b/build/src/main/resources/org/approvaltests/ReporterFactory.class differ diff --git a/build/src/main/resources/org/approvaltests/approvers/ApprovalApprover.class b/build/src/main/resources/org/approvaltests/approvers/ApprovalApprover.class new file mode 100644 index 00000000..9fd47695 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/approvers/ApprovalApprover.class differ diff --git a/build/src/main/resources/org/approvaltests/approvers/FileApprover.class b/build/src/main/resources/org/approvaltests/approvers/FileApprover.class new file mode 100644 index 00000000..398ece84 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/approvers/FileApprover.class differ diff --git a/build/src/main/resources/org/approvaltests/core/ApprovalFailureOverrider.class b/build/src/main/resources/org/approvaltests/core/ApprovalFailureOverrider.class new file mode 100644 index 00000000..ea9deb28 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/core/ApprovalFailureOverrider.class differ diff --git a/build/src/main/resources/org/approvaltests/core/ApprovalFailureReporter.class b/build/src/main/resources/org/approvaltests/core/ApprovalFailureReporter.class new file mode 100644 index 00000000..a0f201e2 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/core/ApprovalFailureReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/core/ApprovalReporterWithCleanUp.class b/build/src/main/resources/org/approvaltests/core/ApprovalReporterWithCleanUp.class new file mode 100644 index 00000000..c1e8e367 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/core/ApprovalReporterWithCleanUp.class differ diff --git a/build/src/main/resources/org/approvaltests/core/ApprovalWriter.class b/build/src/main/resources/org/approvaltests/core/ApprovalWriter.class new file mode 100644 index 00000000..b4a1a620 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/core/ApprovalWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/ApprovalNamer.class b/build/src/main/resources/org/approvaltests/namer/ApprovalNamer.class new file mode 100644 index 00000000..5985123b Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/ApprovalNamer.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/ApprovalResults.class b/build/src/main/resources/org/approvaltests/namer/ApprovalResults.class new file mode 100644 index 00000000..f746b3f9 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/ApprovalResults.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer$JUnit3StackSelector.class b/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer$JUnit3StackSelector.class new file mode 100644 index 00000000..1a41ee8e Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer$JUnit3StackSelector.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer.class b/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer.class new file mode 100644 index 00000000..fa740344 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/JUnitStackTraceNamer.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/MultipleFilesLabeller.class b/build/src/main/resources/org/approvaltests/namer/MultipleFilesLabeller.class new file mode 100644 index 00000000..f48a8992 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/MultipleFilesLabeller.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/NamerFactory.class b/build/src/main/resources/org/approvaltests/namer/NamerFactory.class new file mode 100644 index 00000000..d639ea13 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/NamerFactory.class differ diff --git a/build/src/main/resources/org/approvaltests/namer/OsEnvironmentLabeller.class b/build/src/main/resources/org/approvaltests/namer/OsEnvironmentLabeller.class new file mode 100644 index 00000000..37c550ce Binary files /dev/null and b/build/src/main/resources/org/approvaltests/namer/OsEnvironmentLabeller.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/ClipboardReporter.class b/build/src/main/resources/org/approvaltests/reporters/ClipboardReporter.class new file mode 100644 index 00000000..4e9a7530 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/ClipboardReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/DiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/DiffReporter.class new file mode 100644 index 00000000..2e720ee4 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/DiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/EnvironmentAwareReporter.class b/build/src/main/resources/org/approvaltests/reporters/EnvironmentAwareReporter.class new file mode 100644 index 00000000..3ce995c9 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/EnvironmentAwareReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/ExecutableQueryFailure.class b/build/src/main/resources/org/approvaltests/reporters/ExecutableQueryFailure.class new file mode 100644 index 00000000..17de4422 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/ExecutableQueryFailure.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/FileLauncherReporter.class b/build/src/main/resources/org/approvaltests/reporters/FileLauncherReporter.class new file mode 100644 index 00000000..75d7af7e Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/FileLauncherReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/FirstWorkingReporter.class b/build/src/main/resources/org/approvaltests/reporters/FirstWorkingReporter.class new file mode 100644 index 00000000..1b9a637f Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/FirstWorkingReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/GenericDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/GenericDiffReporter.class new file mode 100644 index 00000000..c94967df Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/GenericDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/ImageReporter.class b/build/src/main/resources/org/approvaltests/reporters/ImageReporter.class new file mode 100644 index 00000000..c505d212 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/ImageReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/ImageWebReporter.class b/build/src/main/resources/org/approvaltests/reporters/ImageWebReporter.class new file mode 100644 index 00000000..1c7c1235 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/ImageWebReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/JunitReporter.class b/build/src/main/resources/org/approvaltests/reporters/JunitReporter.class new file mode 100644 index 00000000..73717c1d Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/JunitReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/MultiReporter.class b/build/src/main/resources/org/approvaltests/reporters/MultiReporter.class new file mode 100644 index 00000000..e26f58d8 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/MultiReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/QuietReporter.class b/build/src/main/resources/org/approvaltests/reporters/QuietReporter.class new file mode 100644 index 00000000..da296386 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/QuietReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/UseReporter.class b/build/src/main/resources/org/approvaltests/reporters/UseReporter.class new file mode 100644 index 00000000..5c2c19da Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/UseReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/macosx/DiffMergeReporter.class b/build/src/main/resources/org/approvaltests/reporters/macosx/DiffMergeReporter.class new file mode 100644 index 00000000..1894c9eb Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/macosx/DiffMergeReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/macosx/KaleidoscopeDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/macosx/KaleidoscopeDiffReporter.class new file mode 100644 index 00000000..f506bcfa Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/macosx/KaleidoscopeDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/macosx/MacDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/macosx/MacDiffReporter.class new file mode 100644 index 00000000..3c9f6bfa Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/macosx/MacDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/macosx/P4MergeReporter.class b/build/src/main/resources/org/approvaltests/reporters/macosx/P4MergeReporter.class new file mode 100644 index 00000000..cb4eb7c5 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/macosx/P4MergeReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/macosx/TkDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/macosx/TkDiffReporter.class new file mode 100644 index 00000000..168f9c94 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/macosx/TkDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/BeyondCompareReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/BeyondCompareReporter.class new file mode 100644 index 00000000..433b7882 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/BeyondCompareReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseDiffReporter.class new file mode 100644 index 00000000..38f1ba54 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseImageDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseImageDiffReporter.class new file mode 100644 index 00000000..63324003 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseImageDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseTextDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseTextDiffReporter.class new file mode 100644 index 00000000..6b1e232e Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/TortoiseTextDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/WinMergeReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/WinMergeReporter.class new file mode 100644 index 00000000..1556fff8 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/WinMergeReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/reporters/windows/WindowsDiffReporter.class b/build/src/main/resources/org/approvaltests/reporters/windows/WindowsDiffReporter.class new file mode 100644 index 00000000..091676c8 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/reporters/windows/WindowsDiffReporter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ApprovalBinaryFileWriter.class b/build/src/main/resources/org/approvaltests/writers/ApprovalBinaryFileWriter.class new file mode 100644 index 00000000..409ef43f Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ApprovalBinaryFileWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ApprovalTextWriter.class b/build/src/main/resources/org/approvaltests/writers/ApprovalTextWriter.class new file mode 100644 index 00000000..28ba47b6 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ApprovalTextWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ApprovalXmlWriter.class b/build/src/main/resources/org/approvaltests/writers/ApprovalXmlWriter.class new file mode 100644 index 00000000..9f90ddba Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ApprovalXmlWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ComponentApprovalWriter.class b/build/src/main/resources/org/approvaltests/writers/ComponentApprovalWriter.class new file mode 100644 index 00000000..0d943380 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ComponentApprovalWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/DirectoryToDirectoryWriter.class b/build/src/main/resources/org/approvaltests/writers/DirectoryToDirectoryWriter.class new file mode 100644 index 00000000..a97edabe Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/DirectoryToDirectoryWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/FileApprovalWriter.class b/build/src/main/resources/org/approvaltests/writers/FileApprovalWriter.class new file mode 100644 index 00000000..eef39c70 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/FileApprovalWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ImageApprovalWriter.class b/build/src/main/resources/org/approvaltests/writers/ImageApprovalWriter.class new file mode 100644 index 00000000..57a9b51a Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ImageApprovalWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/ResultSetApprovalWriter.class b/build/src/main/resources/org/approvaltests/writers/ResultSetApprovalWriter.class new file mode 100644 index 00000000..2e840602 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/ResultSetApprovalWriter.class differ diff --git a/build/src/main/resources/org/approvaltests/writers/Writer.class b/build/src/main/resources/org/approvaltests/writers/Writer.class new file mode 100644 index 00000000..90bfd264 Binary files /dev/null and b/build/src/main/resources/org/approvaltests/writers/Writer.class differ diff --git a/build/src/main/resources/org/jrack/RackResponse.class b/build/src/main/resources/org/jrack/RackResponse.class new file mode 100644 index 00000000..e49392c5 Binary files /dev/null and b/build/src/main/resources/org/jrack/RackResponse.class differ diff --git a/build/src/main/resources/org/jrack/RackResponseUtils$ReturnCode.class b/build/src/main/resources/org/jrack/RackResponseUtils$ReturnCode.class new file mode 100644 index 00000000..e4dc173a Binary files /dev/null and b/build/src/main/resources/org/jrack/RackResponseUtils$ReturnCode.class differ diff --git a/build/src/main/resources/org/jrack/RackResponseUtils.class b/build/src/main/resources/org/jrack/RackResponseUtils.class new file mode 100644 index 00000000..5bac4f85 Binary files /dev/null and b/build/src/main/resources/org/jrack/RackResponseUtils.class differ diff --git a/build/src/main/resources/org/lambda/actions/Action0.class b/build/src/main/resources/org/lambda/actions/Action0.class new file mode 100644 index 00000000..e9e3c012 Binary files /dev/null and b/build/src/main/resources/org/lambda/actions/Action0.class differ diff --git a/build/src/main/resources/org/lambda/functions/Function0.class b/build/src/main/resources/org/lambda/functions/Function0.class new file mode 100644 index 00000000..35176aaf Binary files /dev/null and b/build/src/main/resources/org/lambda/functions/Function0.class differ diff --git a/build/src/main/resources/org/lambda/functions/Function1.class b/build/src/main/resources/org/lambda/functions/Function1.class new file mode 100644 index 00000000..5ae4705d Binary files /dev/null and b/build/src/main/resources/org/lambda/functions/Function1.class differ diff --git a/build/src/main/resources/org/lambda/functions/implementations/F1.class b/build/src/main/resources/org/lambda/functions/implementations/F1.class new file mode 100644 index 00000000..0c664520 Binary files /dev/null and b/build/src/main/resources/org/lambda/functions/implementations/F1.class differ diff --git a/build/src/main/resources/org/lambda/functions/implementations/Function.class b/build/src/main/resources/org/lambda/functions/implementations/Function.class new file mode 100644 index 00000000..401e7aba Binary files /dev/null and b/build/src/main/resources/org/lambda/functions/implementations/Function.class differ diff --git a/build/src/main/resources/org/lambda/query/Echo1.class b/build/src/main/resources/org/lambda/query/Echo1.class new file mode 100644 index 00000000..51dc2de3 Binary files /dev/null and b/build/src/main/resources/org/lambda/query/Echo1.class differ diff --git a/build/src/main/resources/org/lambda/query/OrderBy$Order.class b/build/src/main/resources/org/lambda/query/OrderBy$Order.class new file mode 100644 index 00000000..897beebb Binary files /dev/null and b/build/src/main/resources/org/lambda/query/OrderBy$Order.class differ diff --git a/build/src/main/resources/org/lambda/query/OrderBy.class b/build/src/main/resources/org/lambda/query/OrderBy.class new file mode 100644 index 00000000..0dd3887a Binary files /dev/null and b/build/src/main/resources/org/lambda/query/OrderBy.class differ diff --git a/build/src/main/resources/org/lambda/query/Query.class b/build/src/main/resources/org/lambda/query/Query.class new file mode 100644 index 00000000..4ba48ddc Binary files /dev/null and b/build/src/main/resources/org/lambda/query/Query.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/ColorWheel.class b/build/src/main/resources/org/teachingextensions/logo/ColorWheel.class new file mode 100644 index 00000000..6ffe5b8a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/ColorWheel.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/ColorWheel.java b/build/src/main/resources/org/teachingextensions/logo/ColorWheel.java new file mode 100644 index 00000000..30b62e6d --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/ColorWheel.java @@ -0,0 +1,60 @@ +package org.teachingextensions.logo; + +import java.awt.Color; + +/** + * ColorWheel is a place to store a color palette.
+ * Example: If you have a palette of + * blue, + * red, + * and purple
+ * and then used it to print out the numbers, you would get
+ * 1 + * 2 + * 3 + * 4 + * 5 + * 6 + * 7 + * 8 + * 9 + */ +public class ColorWheel +{ + private static Wheel wheel = new Wheel(); + /** + * This method adds a color to the ColorWheel.
+ * Example: {@code ColorWheel.addColor(Colors.Reds.Red);} + * + * @param color + * the color to add to the wheel + */ + public static void addColor(Color color) + { + wheel.add(color); + } + /** + * This method returns the next color of the ColorWheel.
+ * Example: {@code Color penColor = ColorWheel.getNextColor();} + * + * @return the next color of the ColorWheel + */ + public static Color getNextColor() + { + return wheel.next(); + } + /** + * This method returns the a random color from the options on the ColorWheel.
+ * Example: {@code Color penColor = ColorWheel.getNextColor();} + * + * @return A random color from the ColorWheel + */ + public static Color getRandomColorFromWheel() + { + return wheel.getRandomFrom(); + } + public static void removeAllColors() + { + wheel.empty(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Blues.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Blues.class new file mode 100644 index 00000000..fd29b2ad Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Blues.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Browns.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Browns.class new file mode 100644 index 00000000..4cccff6c Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Browns.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Grays.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Grays.class new file mode 100644 index 00000000..c8adb87c Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Grays.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Greens.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Greens.class new file mode 100644 index 00000000..b80e3f99 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Greens.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Oranges.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Oranges.class new file mode 100644 index 00000000..2680c83d Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Oranges.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Pinks.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Pinks.class new file mode 100644 index 00000000..e7bf7904 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Pinks.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Purples.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Purples.class new file mode 100644 index 00000000..cf83d0f8 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Purples.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Reds.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Reds.class new file mode 100644 index 00000000..5ffb7c80 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Reds.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Whites.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Whites.class new file mode 100644 index 00000000..fe50d048 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Whites.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors$Yellows.class b/build/src/main/resources/org/teachingextensions/logo/Colors$Yellows.class new file mode 100644 index 00000000..9912bddb Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors$Yellows.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors.class b/build/src/main/resources/org/teachingextensions/logo/Colors.class new file mode 100644 index 00000000..d7a18d74 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Colors.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Colors.java b/build/src/main/resources/org/teachingextensions/logo/Colors.java new file mode 100644 index 00000000..3cd3e6e1 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/Colors.java @@ -0,0 +1,1551 @@ +package org.teachingextensions.logo; + +import java.awt.Color; +import java.util.Random; + +/** + * Every color under the + * rainbow, + * and different ways to get them. + */ +public class Colors +{ + public static class Blues + { + /** + * The color Navy + * + * + * + * + *
 
+ **/ + public static final Color Navy = Color.decode("#000080"); + /** + * The color DarkBlue + * + * + * + * + *
 
+ **/ + public static final Color DarkBlue = Color.decode("#00008B"); + /** + * The color MidnightBlue + * + * + * + * + *
 
+ **/ + public static final Color MidnightBlue = Color.decode("#191970"); + /** + * The color MediumBlue + * + * + * + * + *
 
+ **/ + public static final Color MediumBlue = Color.decode("#0000CD"); + /** + * The color Blue + * + * + * + * + *
 
+ **/ + public static final Color Blue = Color.decode("#0000FF"); + /** + * The color Teal + * + * + * + * + *
 
+ **/ + public static final Color Teal = Color.decode("#008080"); + /** + * The color DarkSlateBlue + * + * + * + * + *
 
+ **/ + public static final Color DarkSlateBlue = Color.decode("#483D8B"); + /** + * The color DarkCyan + * + * + * + * + *
 
+ **/ + public static final Color DarkCyan = Color.decode("#008B8B"); + /** + * The color SteelBlue + * + * + * + * + *
 
+ **/ + public static final Color SteelBlue = Color.decode("#4682B4"); + /** + * The color RoyalBlue + * + * + * + * + *
 
+ **/ + public static final Color RoyalBlue = Color.decode("#4169E1"); + /** + * The color SlateBlue + * + * + * + * + *
 
+ **/ + public static final Color SlateBlue = Color.decode("#6A5ACD"); + /** + * The color CadetBlue + * + * + * + * + *
 
+ **/ + public static final Color CadetBlue = Color.decode("#5F9EA0"); + /** + * The color DarkTurquoise + * + * + * + * + *
 
+ **/ + public static final Color DarkTurquoise = Color.decode("#00CED1"); + /** + * The color DodgerBlue + * + * + * + * + *
 
+ **/ + public static final Color DodgerBlue = Color.decode("#1E90FF"); + /** + * The color DeepSkyBlue + * + * + * + * + *
 
+ **/ + public static final Color DeepSkyBlue = Color.decode("#00BFFF"); + /** + * The color MediumSlateBlue + * + * + * + * + *
 
+ **/ + public static final Color MediumSlateBlue = Color.decode("#7B68EE"); + /** + * The color MediumTurquoise + * + * + * + * + *
 
+ **/ + public static final Color MediumTurquoise = Color.decode("#48D1CC"); + /** + * The color CornflowerBlue + * + * + * + * + *
 
+ **/ + public static final Color CornflowerBlue = Color.decode("#6495ED"); + /** + * The color Turquoise + * + * + * + * + *
 
+ **/ + public static final Color Turquoise = Color.decode("#40E0D0"); + /** + * The color Aqua + * + * + * + * + *
 
+ **/ + public static final Color Aqua = Color.decode("#00FFFF"); + /** + * The color Cyan + * + * + * + * + *
 
+ **/ + public static final Color Cyan = Color.decode("#00FFFF"); + /** + * The color SkyBlue + * + * + * + * + *
 
+ **/ + public static final Color SkyBlue = Color.decode("#87CEEB"); + /** + * The color LightSkyBlue + * + * + * + * + *
 
+ **/ + public static final Color LightSkyBlue = Color.decode("#87CEFA"); + /** + * The color Aquamarine + * + * + * + * + *
 
+ **/ + public static final Color Aquamarine = Color.decode("#7FFFD4"); + /** + * The color LightSteelBlue + * + * + * + * + *
 
+ **/ + public static final Color LightSteelBlue = Color.decode("#B0C4DE"); + /** + * The color LightBlue + * + * + * + * + *
 
+ **/ + public static final Color LightBlue = Color.decode("#ADD8E6"); + /** + * The color PowderBlue + * + * + * + * + *
 
+ **/ + public static final Color PowderBlue = Color.decode("#B0E0E6"); + /** + * The color PaleTurquoise + * + * + * + * + *
 
+ **/ + public static final Color PaleTurquoise = Color.decode("#AFEEEE"); + /** + * The color LightCyan + * + * + * + * + *
 
+ **/ + public static final Color LightCyan = Color.decode("#E0FFFF"); + /** + * The color AliceBlue + * + * + * + * + *
 
+ **/ + public static final Color AliceBlue = Color.decode("#F0F8FF"); + /** + * The color Azure + * + * + * + * + *
 
+ **/ + public static final Color Azure = Color.decode("#F0FFFF"); + } + public static class Browns + { + /** + * The color Maroon + * + * + * + * + *
 
+ **/ + public static final Color Maroon = Color.decode("#800000"); + /** + * The color SaddleBrown + * + * + * + * + *
 
+ **/ + public static final Color SaddleBrown = Color.decode("#8B4513"); + /** + * The color Brown + * + * + * + * + *
 
+ **/ + public static final Color Brown = Color.decode("#A52A2A"); + /** + * The color Sienna + * + * + * + * + *
 
+ **/ + public static final Color Sienna = Color.decode("#A0522D"); + /** + * The color DarkGoldenrod + * + * + * + * + *
 
+ **/ + public static final Color DarkGoldenrod = Color.decode("#B8860B"); + /** + * The color Chocolate + * + * + * + * + *
 
+ **/ + public static final Color Chocolate = Color.decode("#D2691E"); + /** + * The color Peru + * + * + * + * + *
 
+ **/ + public static final Color Peru = Color.decode("#CD853F"); + /** + * The color Goldenrod + * + * + * + * + *
 
+ **/ + public static final Color Goldenrod = Color.decode("#DAA520"); + /** + * The color RosyBrown + * + * + * + * + *
 
+ **/ + public static final Color RosyBrown = Color.decode("#BC8F8F"); + /** + * The color SandyBrown + * + * + * + * + *
 
+ **/ + public static final Color SandyBrown = Color.decode("#F4A460"); + /** + * The color Tan + * + * + * + * + *
 
+ **/ + public static final Color Tan = Color.decode("#D2B48C"); + /** + * The color BurlyWood + * + * + * + * + *
 
+ **/ + public static final Color BurlyWood = Color.decode("#DEB887"); + /** + * The color Wheat + * + * + * + * + *
 
+ **/ + public static final Color Wheat = Color.decode("#F5DEB3"); + /** + * The color NavajoWhite + * + * + * + * + *
 
+ **/ + public static final Color NavajoWhite = Color.decode("#FFDEAD"); + /** + * The color Bisque + * + * + * + * + *
 
+ **/ + public static final Color Bisque = Color.decode("#FFE4C4"); + /** + * The color BlanchedAlmond + * + * + * + * + *
 
+ **/ + public static final Color BlanchedAlmond = Color.decode("#FFEBCD"); + /** + * The color Cornsilk + * + * + * + * + *
 
+ **/ + public static final Color Cornsilk = Color.decode("#FFF8DC"); + } + public static class Grays + { + /** + * The color Black + * + * + * + * + *
 
+ **/ + public static final Color Black = Color.decode("#000000"); + /** + * The color DarkSlateGray + * + * + * + * + *
 
+ **/ + public static final Color DarkSlateGray = Color.decode("#2F4F4F"); + /** + * The color DimGray + * + * + * + * + *
 
+ **/ + public static final Color DimGray = Color.decode("#696969"); + /** + * The color Gray + * + * + * + * + *
 
+ **/ + public static final Color Gray = Color.decode("#808080"); + /** + * The color SlateGray + * + * + * + * + *
 
+ **/ + public static final Color SlateGray = Color.decode("#708090"); + /** + * The color LightSlateGray + * + * + * + * + *
 
+ **/ + public static final Color LightSlateGray = Color.decode("#778899"); + /** + * The color DarkGray + * + * + * + * + *
 
+ **/ + public static final Color DarkGray = Color.decode("#A9A9A9"); + /** + * The color Silver + * + * + * + * + *
 
+ **/ + public static final Color Silver = Color.decode("#C0C0C0"); + /** + * The color LightGray + * + * + * + * + *
 
+ **/ + public static final Color LightGray = Color.decode("#D3D3D3"); + /** + * The color Gainsboro + * + * + * + * + *
 
+ **/ + public static final Color Gainsboro = Color.decode("#DCDCDC"); + } + public static class Greens + { + /** + * The color DarkGreen + * + * + * + * + *
 
+ **/ + public static final Color DarkGreen = Color.decode("#006400"); + /** + * The color Green + * + * + * + * + *
 
+ **/ + public static final Color Green = Color.decode("#008000"); + /** + * The color ForestGreen + * + * + * + * + *
 
+ **/ + public static final Color ForestGreen = Color.decode("#228B22"); + /** + * The color DarkOliveGreen + * + * + * + * + *
 
+ **/ + public static final Color DarkOliveGreen = Color.decode("#556B2F"); + /** + * The color Lime + * + * + * + * + *
 
+ **/ + public static final Color Lime = Color.decode("#00FF00"); + /** + * The color Olive + * + * + * + * + *
 
+ **/ + public static final Color Olive = Color.decode("#808000"); + /** + * The color Teal + * + * + * + * + *
 
+ **/ + public static final Color Teal = Color.decode("#008080"); + /** + * The color SeaGreen + * + * + * + * + *
 
+ **/ + public static final Color SeaGreen = Color.decode("#2E8B57"); + /** + * The color DarkCyan + * + * + * + * + *
 
+ **/ + public static final Color DarkCyan = Color.decode("#008B8B"); + /** + * The color OliveDrab + * + * + * + * + *
 
+ **/ + public static final Color OliveDrab = Color.decode("#6B8E23"); + /** + * The color LimeGreen + * + * + * + * + *
 
+ **/ + public static final Color LimeGreen = Color.decode("#32CD32"); + /** + * The color MediumSeaGreen + * + * + * + * + *
 
+ **/ + public static final Color MediumSeaGreen = Color.decode("#3CB371"); + /** + * The color LawnGreen + * + * + * + * + *
 
+ **/ + public static final Color LawnGreen = Color.decode("#7CFC00"); + /** + * The color LightSeaGreen + * + * + * + * + *
 
+ **/ + public static final Color LightSeaGreen = Color.decode("#20B2AA"); + /** + * The color Chartreuse + * + * + * + * + *
 
+ **/ + public static final Color Chartreuse = Color.decode("#7FFF00"); + /** + * The color SpringGreen + * + * + * + * + *
 
+ **/ + public static final Color SpringGreen = Color.decode("#00FF7F"); + /** + * The color MediumSpringGreen + * + * + * + * + *
 
+ **/ + public static final Color MediumSpringGreen = Color.decode("#00FA9A"); + /** + * The color YellowGreen + * + * + * + * + *
 
+ **/ + public static final Color YellowGreen = Color.decode("#9ACD32"); + /** + * The color DarkTurquoise + * + * + * + * + *
 
+ **/ + public static final Color DarkTurquoise = Color.decode("#00CED1"); + /** + * The color DarkSeaGreen + * + * + * + * + *
 
+ **/ + public static final Color DarkSeaGreen = Color.decode("#8FBC8F"); + /** + * The color GreenYellow + * + * + * + * + *
 
+ **/ + public static final Color GreenYellow = Color.decode("#ADFF2F"); + /** + * The color MediumAquamarine + * + * + * + * + *
 
+ **/ + public static final Color MediumAquamarine = Color.decode("#66CDAA"); + /** + * The color MediumTurquoise + * + * + * + * + *
 
+ **/ + public static final Color MediumTurquoise = Color.decode("#48D1CC"); + /** + * The color Turquoise + * + * + * + * + *
 
+ **/ + public static final Color Turquoise = Color.decode("#40E0D0"); + /** + * The color LightGreen + * + * + * + * + *
 
+ **/ + public static final Color LightGreen = Color.decode("#90EE90"); + /** + * The color PaleGreen + * + * + * + * + *
 
+ **/ + public static final Color PaleGreen = Color.decode("#98FB98"); + /** + * The color Aquamarine + * + * + * + * + *
 
+ **/ + public static final Color Aquamarine = Color.decode("#7FFFD4"); + /** + * The color PaleTurquoise + * + * + * + * + *
 
+ **/ + public static final Color PaleTurquoise = Color.decode("#AFEEEE"); + } + public static class Oranges + { + /** + * The color OrangeRed + * + * + * + * + *
 
+ **/ + public static final Color OrangeRed = Color.decode("#FF4500"); + /** + * The color DarkOrange + * + * + * + * + *
 
+ **/ + public static final Color DarkOrange = Color.decode("#FF8C00"); + /** + * The color Orange + * + * + * + * + *
 
+ **/ + public static final Color Orange = Color.decode("#FFA500"); + /** + * The color Tomato + * + * + * + * + *
 
+ **/ + public static final Color Tomato = Color.decode("#FF6347"); + /** + * The color Coral + * + * + * + * + *
 
+ **/ + public static final Color Coral = Color.decode("#FF7F50"); + /** + * The color LightSalmon + * + * + * + * + *
 
+ **/ + public static final Color LightSalmon = Color.decode("#FFA07A"); + } + public static class Pinks + { + /** + * The color MediumVioletRed + * + * + * + * + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color DeepPink + * + * + * + * + *
 
+ **/ + public static final Color DeepPink = Color.decode("#FF1493"); + /** + * The color PaleVioletRed + * + * + * + * + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color Fuchsia + * + * + * + * + *
 
+ **/ + public static final Color Fuchsia = Color.decode("#FF00FF"); + /** + * The color HotPink + * + * + * + * + *
 
+ **/ + public static final Color HotPink = Color.decode("#FF69B4"); + /** + * The color LightPink + * + * + * + * + *
 
+ **/ + public static final Color LightPink = Color.decode("#FFB6C1"); + /** + * The color Pink + * + * + * + * + *
 
+ **/ + public static final Color Pink = Color.decode("#FFC0CB"); + } + public static class Purples + { + /** + * The color Indigo + * + * + * + * + *
 
+ **/ + public static final Color Indigo = Color.decode("#4B0082"); + /** + * The color Purple + * + * + * + * + *
 
+ **/ + public static final Color Purple = Color.decode("#800080"); + /** + * The color DarkSlateBlue + * + * + * + * + *
 
+ **/ + public static final Color DarkSlateBlue = Color.decode("#483D8B"); + /** + * The color DarkMagenta + * + * + * + * + *
 
+ **/ + public static final Color DarkMagenta = Color.decode("#8B008B"); + /** + * The color MediumVioletRed + * + * + * + * + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color DarkViolet + * + * + * + * + *
 
+ **/ + public static final Color DarkViolet = Color.decode("#9400D3"); + /** + * The color SlateBlue + * + * + * + * + *
 
+ **/ + public static final Color SlateBlue = Color.decode("#6A5ACD"); + /** + * The color BlueViolet + * + * + * + * + *
 
+ **/ + public static final Color BlueViolet = Color.decode("#8A2BE2"); + /** + * The color DarkOrchid + * + * + * + * + *
 
+ **/ + public static final Color DarkOrchid = Color.decode("#9932CC"); + /** + * The color MediumSlateBlue + * + * + * + * + *
 
+ **/ + public static final Color MediumSlateBlue = Color.decode("#7B68EE"); + /** + * The color RosyBrown + * + * + * + * + *
 
+ **/ + public static final Color RosyBrown = Color.decode("#BC8F8F"); + /** + * The color MediumPurple + * + * + * + * + *
 
+ **/ + public static final Color MediumPurple = Color.decode("#9370DB"); + /** + * The color PaleVioletRed + * + * + * + * + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color MediumOrchid + * + * + * + * + *
 
+ **/ + public static final Color MediumOrchid = Color.decode("#BA55D3"); + /** + * The color Fuchsia + * + * + * + * + *
 
+ **/ + public static final Color Fuchsia = Color.decode("#FF00FF"); + /** + * The color Magenta + * + * + * + * + *
 
+ **/ + public static final Color Magenta = Color.decode("#FF00FF"); + /** + * The color Orchid + * + * + * + * + *
 
+ **/ + public static final Color Orchid = Color.decode("#DA70D6"); + /** + * The color Plum + * + * + * + * + *
 
+ **/ + public static final Color Plum = Color.decode("#DDA0DD"); + /** + * The color Violet + * + * + * + * + *
 
+ **/ + public static final Color Violet = Color.decode("#EE82EE"); + /** + * The color Thistle + * + * + * + * + *
 
+ **/ + public static final Color Thistle = Color.decode("#D8BFD8"); + /** + * The color Lavender + * + * + * + * + *
 
+ **/ + public static final Color Lavender = Color.decode("#E6E6FA"); + } + public static class Reds + { + /** + * The color DarkRed + * + * + * + * + *
 
+ **/ + public static final Color DarkRed = Color.decode("#8B0000"); + /** + * The color FireBrick + * + * + * + * + *
 
+ **/ + public static final Color FireBrick = Color.decode("#B22222"); + /** + * The color Red + * + * + * + * + *
 
+ **/ + public static final Color Red = Color.decode("#FF0000"); + /** + * The color Crimson + * + * + * + * + *
 
+ **/ + public static final Color Crimson = Color.decode("#DC143C"); + /** + * The color OrangeRed + * + * + * + * + *
 
+ **/ + public static final Color OrangeRed = Color.decode("#FF4500"); + /** + * The color MediumVioletRed + * + * + * + * + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color IndianRed + * + * + * + * + *
 
+ **/ + public static final Color IndianRed = Color.decode("#CD5C5C"); + /** + * The color Tomato + * + * + * + * + *
 
+ **/ + public static final Color Tomato = Color.decode("#FF6347"); + /** + * The color PaleVioletRed + * + * + * + * + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color Salmon + * + * + * + * + *
 
+ **/ + public static final Color Salmon = Color.decode("#FA8072"); + /** + * The color LightCoral + * + * + * + * + *
 
+ **/ + public static final Color LightCoral = Color.decode("#F08080"); + /** + * The color DarkSalmon + * + * + * + * + *
 
+ **/ + public static final Color DarkSalmon = Color.decode("#E9967A"); + /** + * The color LightSalmon + * + * + * + * + *
 
+ **/ + public static final Color LightSalmon = Color.decode("#FFA07A"); + } + public static class Whites + { + /** + * The color AntiqueWhite + * + * + * + * + *
 
+ **/ + public static final Color AntiqueWhite = Color.decode("#FAEBD7"); + /** + * The color MistyRose + * + * + * + * + *
 
+ **/ + public static final Color MistyRose = Color.decode("#FFE4E1"); + /** + * The color Beige + * + * + * + * + *
 
+ **/ + public static final Color Beige = Color.decode("#F5F5DC"); + /** + * The color Linen + * + * + * + * + *
 
+ **/ + public static final Color Linen = Color.decode("#FAF0E6"); + /** + * The color OldLace + * + * + * + * + *
 
+ **/ + public static final Color OldLace = Color.decode("#FDF5E6"); + /** + * The color Honeydew + * + * + * + * + *
 
+ **/ + public static final Color Honeydew = Color.decode("#F0FFF0"); + /** + * The color WhiteSmoke + * + * + * + * + *
 
+ **/ + public static final Color WhiteSmoke = Color.decode("#F5F5F5"); + /** + * The color Seashell + * + * + * + * + *
 
+ **/ + public static final Color Seashell = Color.decode("#FFF5EE"); + /** + * The color LavenderBlush + * + * + * + * + *
 
+ **/ + public static final Color LavenderBlush = Color.decode("#FFF0F5"); + /** + * The color AliceBlue + * + * + * + * + *
 
+ **/ + public static final Color AliceBlue = Color.decode("#F0F8FF"); + /** + * The color FloralWhite + * + * + * + * + *
 
+ **/ + public static final Color FloralWhite = Color.decode("#FFFAF0"); + /** + * The color MintCream + * + * + * + * + *
 
+ **/ + public static final Color MintCream = Color.decode("#F5FFFA"); + /** + * The color Azure + * + * + * + * + *
 
+ **/ + public static final Color Azure = Color.decode("#F0FFFF"); + /** + * The color Ivory + * + * + * + * + *
 
+ **/ + public static final Color Ivory = Color.decode("#FFFFF0"); + /** + * The color GhostWhite + * + * + * + * + *
 
+ **/ + public static final Color GhostWhite = Color.decode("#F8F8FF"); + /** + * The color Snow + * + * + * + * + *
 
+ **/ + public static final Color Snow = Color.decode("#FFFAFA"); + /** + * The color White + * + * + * + * + *
 
+ **/ + public static final Color White = Color.decode("#FFFFFF"); + } + public static class Yellows + { + /** + * The color DarkGoldenrod + * + * + * + * + *
 
+ **/ + public static final Color DarkGoldenrod = Color.decode("#B8860B"); + /** + * The color Goldenrod + * + * + * + * + *
 
+ **/ + public static final Color Goldenrod = Color.decode("#DAA520"); + /** + * The color Gold + * + * + * + * + *
 
+ **/ + public static final Color Gold = Color.decode("#FFD700"); + /** + * The color DarkKhaki + * + * + * + * + *
 
+ **/ + public static final Color DarkKhaki = Color.decode("#BDB76B"); + /** + * The color Yellow + * + * + * + * + *
 
+ **/ + public static final Color Yellow = Color.decode("#FFFF00"); + /** + * The color Khaki + * + * + * + * + *
 
+ **/ + public static final Color Khaki = Color.decode("#F0E68C"); + /** + * The color PaleGoldenrod + * + * + * + * + *
 
+ **/ + public static final Color PaleGoldenrod = Color.decode("#EEE8AA"); + /** + * The color PeachPuff + * + * + * + * + *
 
+ **/ + public static final Color PeachPuff = Color.decode("#FFDAB9"); + /** + * The color Moccasin + * + * + * + * + *
 
+ **/ + public static final Color Moccasin = Color.decode("#FFE4B5"); + /** + * The color PapayaWhip + * + * + * + * + *
 
+ **/ + public static final Color PapayaWhip = Color.decode("#FFEFD5"); + /** + * The color LemonChiffon + * + * + * + * + *
 
+ **/ + public static final Color LemonChiffon = Color.decode("#FFFACD"); + /** + * The color LightGoldenrodYellow + * + * + * + * + *
 
+ **/ + public static final Color LightGoldenrodYellow = Color.decode("#FAFAD2"); + /** + * The color LightYellow + * + * + * + * + *
 
+ **/ + public static final Color LightYellow = Color.decode("#FFFFE0"); + } + private static Random RANDOM = new Random(); + public static Color darken(Color color) + { + int red = decrease(color.getRed(), 10); + int green = decrease(color.getGreen(), 10); + int blue = decrease(color.getBlue(), 10); + return new Color(red, green, blue); + } + private static int decrease(int amount, int decreaseBy) + { + return Math.max(0, amount - decreaseBy); + } + public static Color lighten(Color color) + { + int red = increase(color.getRed(), 10); + int green = increase(color.getGreen(), 10); + int blue = increase(color.getBlue(), 10); + return new Color(red, green, blue); + } + private static int increase(int amount, int increaseBy) + { + return Math.min(255, amount + increaseBy); + } + public static Color getRandomColor() + { + return new Color(RANDOM.nextInt(255), RANDOM.nextInt(255), RANDOM.nextInt(255)); + } + public static void mockRandom() + { + RANDOM.setSeed(5); + } + public static int calculateTransparency(int percentTransparent) + { + int opacity = (percentTransparent * 255) / 100; + return (255 - opacity); + } + public static Color getTransparentVersion(Color color, int percentTransparency) + { + return new Color(color.getRed(), color.getGreen(), color.getBlue(), calculateTransparency(percentTransparency)); + } +} \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.class b/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.class new file mode 100644 index 00000000..480d61fc Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.java b/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.java new file mode 100644 index 00000000..a9c79732 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/CompositeStroke.java @@ -0,0 +1,18 @@ +package org.teachingextensions.logo; + +import java.awt.Shape; +import java.awt.Stroke; + +public class CompositeStroke implements Stroke +{ + private Stroke stroke1, stroke2; + public CompositeStroke(Stroke stroke1, Stroke stroke2) + { + this.stroke1 = stroke1; + this.stroke2 = stroke2; + } + public Shape createStrokedShape(Shape shape) + { + return stroke2.createStrokedShape(stroke1.createStrokedShape(shape)); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/ImageBackground.class b/build/src/main/resources/org/teachingextensions/logo/ImageBackground.class new file mode 100644 index 00000000..1e11482a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/ImageBackground.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/ImageBackground.java b/build/src/main/resources/org/teachingextensions/logo/ImageBackground.java new file mode 100644 index 00000000..9e1fbc61 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/ImageBackground.java @@ -0,0 +1,37 @@ +package org.teachingextensions.logo; + +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; +import java.net.URL; + +import javax.imageio.ImageIO; +import javax.swing.JPanel; + +import com.spun.util.ObjectUtils; + +public class ImageBackground implements Paintable +{ + private BufferedImage image; + public ImageBackground(String uri) + { + try + { + URL url = new URL(uri); + image = ImageIO.read(url); + } + catch (Throwable e) + { + throw ObjectUtils.throwAsError(e); + } + } + @Override + public void paint(Graphics2D g, JPanel caller) + { + Rectangle bounds = g.getClipBounds(); + Image img = image; + g.drawImage(img, 0, 0, caller.getWidth(), caller.getHeight(), 0, 0, img.getWidth(null), img.getHeight(null), + null); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/LineSegment.class b/build/src/main/resources/org/teachingextensions/logo/LineSegment.class new file mode 100644 index 00000000..b3a30822 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/LineSegment.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/LineSegment.java b/build/src/main/resources/org/teachingextensions/logo/LineSegment.java new file mode 100644 index 00000000..620f6334 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/LineSegment.java @@ -0,0 +1,36 @@ +package org.teachingextensions.logo; + +import java.awt.Color; +import java.awt.Point; + +public class LineSegment +{ + private Color color; + private Point start; + private Point end; + private final int width; + public LineSegment(Color color, Point start, Point end, int width) + { + super(); + this.color = color; + this.start = start; + this.end = end; + this.width = width; + } + public Color getColor() + { + return color; + } + public Point getStart() + { + return start; + } + public Point getEnd() + { + return end; + } + public float getWidth() + { + return width; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Paintable$1.class b/build/src/main/resources/org/teachingextensions/logo/Paintable$1.class new file mode 100644 index 00000000..a83ac9b1 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Paintable$1.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Paintable.class b/build/src/main/resources/org/teachingextensions/logo/Paintable.class new file mode 100644 index 00000000..57d6d26a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Paintable.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Paintable.java b/build/src/main/resources/org/teachingextensions/logo/Paintable.java new file mode 100644 index 00000000..e23f5128 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/Paintable.java @@ -0,0 +1,16 @@ +package org.teachingextensions.logo; + +import java.awt.Graphics2D; + +import javax.swing.JPanel; + +public interface Paintable +{ + public static Paintable NOTHING = new Paintable() + { + public void paint(Graphics2D g, JPanel caller) + { + } + }; + void paint(Graphics2D g, JPanel caller); +} diff --git a/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.class b/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.class new file mode 100644 index 00000000..761fc1b3 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.java b/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.java new file mode 100644 index 00000000..f6805b80 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/ScreenCapture.java @@ -0,0 +1,31 @@ +package org.teachingextensions.logo; + +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; + +import org.approvaltests.writers.ComponentApprovalWriter; + +public class ScreenCapture +{ + public static BufferedImage getScaledImageOf(Component component, int width, int height) + { + BufferedImage image = ComponentApprovalWriter.drawComponent(component); + return scaleImage(image, width, height); + } + public static BufferedImage scaleImage(BufferedImage image, int width, int height) + { + return toBufferedImage(image.getScaledInstance(width, height, Image.SCALE_SMOOTH)); + } + public static BufferedImage toBufferedImage(Image image) + { + if (image instanceof BufferedImage) { return (BufferedImage) image; } + BufferedImage buffered = new BufferedImage(image.getWidth(null), image.getHeight(null), + BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics = buffered.createGraphics(); + graphics.drawImage(image, 0, 0, null); + graphics.dispose(); + return buffered; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Spider.png b/build/src/main/resources/org/teachingextensions/logo/Spider.png new file mode 100644 index 00000000..f5ff6519 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Spider.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Tortoise.class b/build/src/main/resources/org/teachingextensions/logo/Tortoise.class new file mode 100644 index 00000000..b0b6d867 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Tortoise.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Tortoise.java b/build/src/main/resources/org/teachingextensions/logo/Tortoise.java new file mode 100644 index 00000000..5641bdc4 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/Tortoise.java @@ -0,0 +1,240 @@ +package org.teachingextensions.logo; + +import java.awt.Color; + +import org.teachingextensions.logo.Turtle.Animals; +import org.teachingextensions.logo.utils.TortoiseUtils; + +/** + * + * The Tortoise allows you to draw lines and shapes by moving it around on the canvas + */ +public class Tortoise +{ + /** + * Displays the Tortoise + *
Example: {@code Tortoise.show()}
+ */ + public static void show() + { + turtle().show(); + } + /** + * Sets the speed the tortoise moves + *
Example: {@code Tortoise.setSpeed(8)}
+ * + * @param speed + * The speed from 1 (slowest) to 10 (fastest) + */ + public static void setSpeed(int speed) + { + turtle().setSpeed(speed); + } + /** + * Gets the speed that the tortoise moves + *
Example: {@code int speed = Tortoise.getSpeed(8);}
+ * + * @return the speed the Tortoise is currently set to + */ + public static int getSpeed() + { + return turtle().getSpeed(); + } + /** + * Sets the color drawn by the Tortoise.
+ *
Example: {@code Tortoise.setPenColor(Colors.Reds.Red)}
+ * + * @param color + * the color of the pen + * @see Colors + */ + public static void setPenColor(Color color) + { + turtle().setPenColor(color); + } + /** + * Moves the Tortoise Forward the number of pixels specified.
+ *
Example: {@code Tortoise.move(72)}
+ * + * @param lengthInPixels + * The number of pixels to move. Negative numbers will move the + * Tortoise backwards. + */ + public static void move(Number lengthInPixels) + { + turtle().move(lengthInPixels); + } + /** + * Turns the Tortoise to the right (clockwise) the degrees specified.
+ *
Example: {@code Tortoise.turn(90)}
+ * + * @param degreesToTheRight + * The degrees to turn. Negative numbers will move the Tortoise to + * the left (counter-clockwise) + */ + public static void turn(Number degreesToTheRight) + { + turtle().turn(degreesToTheRight.doubleValue()); + } + /** + * Sets the width of the pen drawn by the Tortoise.
+ *
Example: {@code Tortoise.setPenWidth(2)}
+ * + * @param width + * the width of the pen stroke + */ + public static void setPenWidth(Number width) + { + turtle().setPenWidth(width.intValue()); + } + /** + * Gives you access to the window the + * Tortoise is moving on so you can do things like change it's color.
+ * Example: {@code TurtlePanel panel = Tortoise.getBackgroundWindow()} + */ + public static TurtlePanel getBackgroundWindow() + { + return turtle().getBackgroundWindow(); + } + /** + * Gets the current width of the pen drawn by the Tortoise.
+ *
Example: {@code width = Tortoise.getPenWidth()}
+ * + * @return the width of the pen stroke + */ + public static int getPenWidth() + { + return turtle().getPenWidth(); + } + /** + * Gets the current color of the pen drawn by the Tortoise.
+ *
Example: {@code pen = Tortoise.getPenColor()}
+ * + * @return the color of the pen stroke + */ + public static Color getPenColor() + { + return turtle().getPenColor(); + } + /** + * Sets the position of the Tortoise on the y axis.
+ * (0,0) is the top left of the screen
+ *
Example: {@code Tortoise.setY(30);}
+ * + * @param y + * the position in pixels of the Tortoise on the Y axis + */ + public static void setY(int y) + { + turtle().setY(y); + } + /** + * Sets the position of the Tortoise on the x axis.
+ * (0,0) is the top left of the screen
+ *
Example: {@code Tortoise.setX(30);}
+ * + * @param x + * the position in pixels of the Tortoise on the X axis + */ + public static void setX(int x) + { + turtle().setX(x); + } + /** + * Gets the current position of the Tortoise on the y axis.
+ * (0,0) is the top left of the screen
+ *
Example: {@code y = Tortoise.getY()}
+ * + * @return y the position in pixels of the Tortoise on the Y axis + */ + public static int getY() + { + return turtle().getY(); + } + /** + * Gets the current position of the Tortoise on the x axis.
+ * (0,0) is the top left of the screen
+ *
Example: {@code x = Tortoise.getX()}
+ * + * @return x the position in pixels of the Tortoise on the X axis + */ + public static int getX() + { + return turtle().getX(); + } + /** + * Gets the current heading of the Tortoise.
+ * 0 degrees is due north.
+ * 90 degrees is due east.
+ *
Example: {@code angle = Tortoise.getAngleInDegrees()}
+ * + * @return the angle in degrees of the Tortoise + */ + public static double getAngle() + { + return turtle().getAngleInDegrees(); + } + /** + * Changes the type of animal you are using.
+ *
Example: {@code Tortoise.setAnimal(Animals.Spider);}
+ * + * @return the angle in degrees of the Tortoise + * @see Animals + */ + public static void setAnimal(Animals animal) + { + turtle().setAnimal(animal); + } + /** + * Makes it so the tortoise will not draw a line of color out of it's butt.
+ * Example: {@code Tortoise.penUp()} + */ + public static void penUp() + { + turtle().penUp(); + } + /** + * Makes it so a line of color out of will trail from the Tortoise.
+ * Example: {@code Tortoise.penDown()} + */ + public static void penDown() + { + turtle().penDown(); + } + /** + * Removes everything from the window.
+ * Example: {@code Tortoise.clear()} + */ + public static void clear() + { + turtle().clear(); + } + /** + * Hides the tortoise, you will still see the pen markings it made before and after it hid.
+ * Example: {@code Tortoise.hide()} + */ + public static void hide() + { + turtle().hide(); + } + private static Turtle turtle() + { + return TortoiseUtils.getTurtle(); + } + /** + * Sets the angle the Tortoise is facing.
+ * 0 is straight up (like 'North')
+ *
Example: {@code Tortoise.setAngle(42);}
+ * + * @param angle + * the angle in degrees + */ + public static void setAngle(int angle) + { + turtle().setAngleInDegrees(angle); + } + public static void moveTo(int x, int y) + { + turtle().moveTo(x, y); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle$1.class b/build/src/main/resources/org/teachingextensions/logo/Turtle$1.class new file mode 100644 index 00000000..0ae1483d Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle$1.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle$Animals.class b/build/src/main/resources/org/teachingextensions/logo/Turtle$Animals.class new file mode 100644 index 00000000..5ee50091 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle$Animals.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle$EmptyMover.class b/build/src/main/resources/org/teachingextensions/logo/Turtle$EmptyMover.class new file mode 100644 index 00000000..b3f91e31 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle$EmptyMover.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle$Mover.class b/build/src/main/resources/org/teachingextensions/logo/Turtle$Mover.class new file mode 100644 index 00000000..c58662db Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle$Mover.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle$Turner.class b/build/src/main/resources/org/teachingextensions/logo/Turtle$Turner.class new file mode 100644 index 00000000..59d1aed8 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle$Turner.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle.class b/build/src/main/resources/org/teachingextensions/logo/Turtle.class new file mode 100644 index 00000000..d220feab Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle.java b/build/src/main/resources/org/teachingextensions/logo/Turtle.java new file mode 100644 index 00000000..4265bac1 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/Turtle.java @@ -0,0 +1,306 @@ +package org.teachingextensions.logo; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Point; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JFrame; + +import org.approvaltests.writers.ComponentApprovalWriter; +import org.lambda.actions.Action0; +import org.teachingextensions.windows.ProgramWindow; + +import com.spun.util.ThreadLauncher; +import com.spun.util.persistence.Saver; +import com.spun.util.persistence.SavingException; + +public class Turtle +{ + /** + * Current types are: Turtle, Spider + */ + public enum Animals { + Turtle, Spider + } + private class Turner implements Saver + { + @Override + public Double save(Double save) throws SavingException + { + smallTurn(save); + return save; + } + } + private class Mover implements Saver + { + private final Point starting; + private LineSegment line = null; + public Mover(Point point) + { + this.starting = point; + } + @Override + public Double save(Double save) throws SavingException + { + moveWithoutAnimation(save); + if (line != null) + { + trail.remove(line); + } + line = new LineSegment(color, starting, new Point(getX(), getY()), width); + trail.add(line); + return save; + } + } + private class EmptyMover implements Saver + { + @Override + public Double save(Double save) throws SavingException + { + moveWithoutAnimation(save); + return save; + } + } + private static final double MAX_MOVE_AMOUNT = 5.0; + public static final int TEST_SPEED = Integer.MIN_VALUE; + private double x = 640 / 2; + private double y = 480 / 2; + private double angleInDegrees = 0; + private TurtlePanel panel; + private int speed = 1; + private List trail = new ArrayList(); + private Color color = Color.black; + private int width = 2; + private boolean penDown = true; + private boolean hidden; + public BufferedImage getImage() + { + BufferedImage image = ComponentApprovalWriter.drawComponent(getPanel()); + clear(); + return image; + } + public void clear() + { + trail.clear(); + if (panel != null) + { + panel.removePaintable(); + } + } + private Component getPanel() + { + if (panel == null) + { + String title = "Turtle"; + panel = new TurtlePanel(); + if (speed != TEST_SPEED) + { + JFrame frame = new JFrame(title); + frame.getContentPane().add(panel); + ProgramWindow.createStandardFrame(frame); + } + panel.setTurtle(this); + } + return panel; + } + public int getX() + { + return (int) x; + } + public int getY() + { + return (int) y; + } + public double getAngleInDegrees() + { + return angleInDegrees; + } + public void setAngleInDegrees(double angleInDegrees) + { + this.angleInDegrees = angleInDegrees; + } + public void setX(Number x) + { + this.x = x.doubleValue(); + } + public void setY(Number y) + { + this.y = y.doubleValue(); + } + public void turn(double amount) + { + double max = getTurnAmount(amount); + Saver s = new Turner(); + animate(amount, max, s); + } + private double getTurnAmount(double amount) + { + amount = Math.abs(amount); + if (getSpeed() == TEST_SPEED) { return amount; } + return amount / (11 - getSpeed()); + } + private void animate(double amount, double max, Saver s) + { + double sign = amount > 0 ? 1 : -1; + amount = Math.abs(amount); + while (amount > max) + { + s.save(max * sign); + refreshPanel(); + amount -= max; + } + s.save(amount * sign); + refreshPanel(); + } + private void refreshPanel() + { + long delay = getDelay(); + if (delay != TEST_SPEED) + { + getPanel().repaint(); + try + { + Thread.sleep(delay); + } + catch (InterruptedException e) + { + // do nothing + } + } + } + private void smallTurn(double i) + { + angleInDegrees += i; + } + private long getDelay() + { + if (getSpeed() == 10) { return 1; } + if (getSpeed() == TEST_SPEED) { return TEST_SPEED; } + return 100 / getSpeed(); + } + public void setSpeed(int speed) + { + if (speed != TEST_SPEED) + { + if (speed < 1 || 10 < speed) { throw new RuntimeException( + String + .format( + "I call shenanigans!!!\nThe speed '%s' is not between the acceptable range of [1-10]\nPerhaps you should read the documentation", + speed)); } + } + this.speed = speed; + } + public int getSpeed() + { + return speed; + } + public double getHeadingInDegrees() + { + return angleInDegrees; + } + public void move(Number amount) + { + double max = MAX_MOVE_AMOUNT; + Saver s = penDown ? new Mover(new Point(getX(), getY())) : new EmptyMover(); + animate(amount.doubleValue(), max, s); + } + private void moveWithoutAnimation(Double save) + { + x += getDeltaX(save, angleInDegrees); + y += getDeltaY(save, angleInDegrees); + } + public static double getDeltaY(double i, double angleInDegrees2) + { + return -i * Math.cos(Math.toRadians(angleInDegrees2)); + } + public static double getDeltaX(double i, double angleInDegrees2) + { + return i * Math.sin(Math.toRadians(angleInDegrees2)); + } + public LineSegment[] getTrail() + { + return trail.toArray(new LineSegment[0]); + } + public void setPenColor(Color color) + { + this.color = color; + } + public Color getPenColor() + { + return color; + } + public int getPenWidth() + { + return width; + } + public void setPenWidth(int width) + { + this.width = width; + } + public void show() + { + hidden = false; + refreshPanel(); + } + public TurtlePanel getBackgroundWindow() + { + return (TurtlePanel) getPanel(); + } + public void setAnimal(Animals animal) + { + refreshPanel(); + getBackgroundWindow().setAnimal(animal); + } + public void penUp() + { + penDown = false; + } + public void penDown() + { + penDown = true; + } + public void print(String string) + { + // TODO Auto-generated method stub + } + public void hide() + { + hidden = true; + } + public boolean isHidden() + { + return hidden; + } + public void moveTo(final int x, final int y) + { + ThreadLauncher.launch(new Action0() + { + @Override + public void call() + { + moveSynchronized(x, y); + } + }); + } + public void moveSynchronized(int x, int y) + { + double angleOfWherePointIs = angleCalculator(getX(), getY(), x, y); + double direction = angleOfWherePointIs - getAngleInDegrees(); + turn(direction); + // move the turtle the distance to the x y point + double distance = new Point(x, y).distance(getX(), getY()); + move(distance); + } + public static double angleCalculator(int x1, int y1, int x2, int y2) + { + int delta_x = x1 - x2; + int delta_y = y1 - y2; + double theta_radians = Math.atan2(delta_y, delta_x); + double degrees = Math.toDegrees(theta_radians); + double degreesWith0North = degrees - 90; + return degreesWith0North; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Turtle.png b/build/src/main/resources/org/teachingextensions/logo/Turtle.png new file mode 100644 index 00000000..9226aeb0 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Turtle.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.class b/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.class new file mode 100644 index 00000000..ea5b593f Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.java b/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.java new file mode 100644 index 00000000..65c5b948 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/TurtlePanel.java @@ -0,0 +1,77 @@ +package org.teachingextensions.logo; + +import java.awt.BasicStroke; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.geom.AffineTransform; +import java.awt.geom.Line2D; + +import javax.swing.ImageIcon; + +import org.teachingextensions.logo.Turtle.Animals; +import org.teachingextensions.windows.ProgramWindow; + +public class TurtlePanel extends ProgramWindow +{ + private Turtle turtle; + private Image image; + public TurtlePanel() + { + } + public void setTurtle(Turtle turtle) + { + this.turtle = turtle; + } + @Override + public void paint(Graphics g) + { + super.paint(g); + paintLines((Graphics2D) g); + paintTurtle((Graphics2D) g); + } + private void paintLines(Graphics2D g) + { + if (turtle == null) { return; } + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); + g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); + g.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); + for (LineSegment l : turtle.getTrail()) + { + if (l != null) + { + g.setColor(l.getColor()); + g.setStroke(new BasicStroke(l.getWidth(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); + g.draw(new Line2D.Double(l.getStart().x, l.getStart().y, l.getEnd().x, l.getEnd().y)); + } + } + } + private void paintTurtle(Graphics2D g) + { + if (turtle == null || turtle.isHidden()) { return; } + Image image = getImage(); + int xCenter = image.getWidth(null) / 2; + int yCenter = image.getHeight(null) / 2; + int x = turtle.getX() - xCenter; + int y = turtle.getY() - yCenter; + AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(turtle.getHeadingInDegrees()), + xCenter, yCenter); + AffineTransform move = AffineTransform.getTranslateInstance(x, y); + move.concatenate(rotate); + g.drawImage(image, move, null); + } + public synchronized Image getImage() + { + if (image == null) + { + setAnimal(Animals.Turtle); + } + return image; + } + public synchronized void setAnimal(Animals animal) + { + image = new ImageIcon(this.getClass().getResource(animal + ".png")).getImage(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.class b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.class new file mode 100644 index 00000000..6d203c55 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.java b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.java new file mode 100644 index 00000000..e762c5f0 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorFileSystem.java @@ -0,0 +1,33 @@ +package org.teachingextensions.logo; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; + +import com.spun.util.MySystem; + +public class VirtualProctorFileSystem extends WindowAdapter +{ + @Override + public void windowClosing(WindowEvent event) + { + BufferedImage scaled = ScreenCapture.getScaledImageOf(event.getComponent(), 200, 150); + sendImageToDisk(scaled); + } + public void sendImageToDisk(BufferedImage image) + { + try + { + String filename = "C:\\temp\\VirtualProctor.png"; + ImageIO.write(image, "png", new File(filename)); + //TestUtils.displayFile(filename); + } + catch (Exception e) + { + MySystem.warning(e); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb$1.class b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb$1.class new file mode 100644 index 00000000..c7eb344b Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb$1.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.class b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.class new file mode 100644 index 00000000..844e80e6 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.java b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.java new file mode 100644 index 00000000..86604607 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/VirtualProctorWeb.java @@ -0,0 +1,81 @@ +package org.teachingextensions.logo; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.net.UnknownHostException; + +import javax.imageio.ImageIO; + +import org.lambda.actions.Action0; +import org.teachingextensions.utils.VirtualProctor; + +import com.spun.util.MySystem; +import com.spun.util.ThreadLauncher; +import com.spun.util.ThreadUtils; +import com.spun.util.io.FileUtils; + +public class VirtualProctorWeb extends WindowAdapter +{ + private boolean finished = false; + @Override + public void windowClosing(WindowEvent event) + { + final BufferedImage scaled = ScreenCapture.getScaledImageOf(event.getComponent(), 200, 150); + ThreadLauncher.launch(new Action0() + { + @Override + public void call() + { + sendImageToWeb(scaled); + finished = true; + } + }); + } + public void sendImageToDisk(BufferedImage image) throws IOException + { + String filename = "C:\\temp\\VirtualProctor.png"; + ImageIO.write(image, "png", new File(filename)); + //TestUtils.displayFile(filename); + } + @Override + public void windowClosed(WindowEvent e) + { + while (!finished) + { + ThreadUtils.sleep(50); + } + } + public void sendImageToWeb(BufferedImage image) + { + try + { + String urlFormat = "http://virtualproctor-tkp.appspot.com/org.teachingkidsprogramming.virtualproctor.UploadImageRack?fileName=%s.png"; + String name = URLEncoder.encode(VirtualProctor.internals.getName(), "ISO-8859-1"); + URL url = new URL(String.format(urlFormat, name)); + URLConnection connection = url.openConnection(); + connection.setDoOutput(true); + connection.setDoInput(true); + OutputStream outputStream = connection.getOutputStream(); + ImageIO.write(image, "png", outputStream); + outputStream.close(); + String content = FileUtils.readStream((InputStream) connection.getContent()); + MySystem.event(content); + } + catch (UnknownHostException e) + { + MySystem.event("No internet connection"); + } + catch (Exception e) + { + MySystem.warning(e); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/Wheel.class b/build/src/main/resources/org/teachingextensions/logo/Wheel.class new file mode 100644 index 00000000..25e3f6b7 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/Wheel.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/Wheel.java b/build/src/main/resources/org/teachingextensions/logo/Wheel.java new file mode 100644 index 00000000..fa17bb52 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/Wheel.java @@ -0,0 +1,72 @@ +package org.teachingextensions.logo; + +import java.util.ArrayList; +import java.util.List; + +import com.spun.util.NumberUtils; + +/** + * A Wheel is a List with no ending on beginning
+ * + * Example: {@code + * Wheel names = new Wheel(); + * names.add("Chocolate"); + * names.add("Peanut Butter"); + * for(int i = 0; i < 6; i++) > { + * String name = names.next(); + * System.out.print(name + " "); + * } + * } + * Would result in :
+ * Chocolate Peanut Butter Chocolate Peanut Butter Chocolate Peanut Butter + * + * @param + */ +public class Wheel +{ + private List list = new ArrayList(); + private int index = 0; + public Wheel(T... loadWith) + { + for (T t : loadWith) + { + add(t); + } + } + public Wheel() + { + } + public void add(T i) + { + list.add(i); + } + public T next() + { + assertNonEmpty(); + if (index >= list.size()) + { + index = 0; + } + T t = list.get(index++); + return t; + } + private void assertNonEmpty() + { + if (list.isEmpty()) + { + String message = "I call shenanigans!!!\nThis Wheel is empty\nYou can NOT get something from the Wheel before you've added anything to it."; + throw new RuntimeException(message); + } + } + public T getRandomFrom() + { + assertNonEmpty(); + int index = NumberUtils.getRandomInt(0, list.size()); + return list.get(index); + } + public void empty() + { + list.clear(); + index = 0; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.class b/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.class new file mode 100644 index 00000000..dc406627 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.java b/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.java new file mode 100644 index 00000000..546b32fa --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/shapes/Circle.java @@ -0,0 +1,44 @@ +package org.teachingextensions.logo.shapes; + +import java.awt.Color; +import java.awt.Graphics2D; + +import javax.swing.JPanel; + +import org.teachingextensions.logo.Colors; +import org.teachingextensions.logo.Paintable; +import org.teachingextensions.windows.ProgramWindow; + +public class Circle implements Paintable +{ + private final int radius; + private final Color mainColor; + private int x; + private int y; + private int percentTransparent; + public Circle(int radius, Color color) + { + this.radius = radius; + this.mainColor = color; + } + public void setCenter(int x, int y) + { + this.x = x; + this.y = y; + } + public void addTo(ProgramWindow panel) + { + panel.addPaintable(this); + } + @Override + public void paint(Graphics2D g, JPanel caller) + { + Color color2 = Colors.getTransparentVersion(mainColor, percentTransparent); + g.setColor(color2); + g.fillOval(x - radius, y - radius, radius * 2, radius * 2); + } + public void setTransparency(int percentTransparent) + { + this.percentTransparent = percentTransparent; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/shapes/Text.class b/build/src/main/resources/org/teachingextensions/logo/shapes/Text.class new file mode 100644 index 00000000..18e08b58 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/shapes/Text.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/shapes/Text.java b/build/src/main/resources/org/teachingextensions/logo/shapes/Text.java new file mode 100644 index 00000000..5cbbefd9 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/shapes/Text.java @@ -0,0 +1,38 @@ +package org.teachingextensions.logo.shapes; + +import java.awt.Font; +import java.awt.Graphics2D; + +import javax.swing.JPanel; + +import org.teachingextensions.logo.Paintable; +import org.teachingextensions.logo.TurtlePanel; + +public class Text implements Paintable +{ + private final String string; + private int x; + private int y; + public Text(String string) + { + this.string = string; + } + public Text setTopLeft(int x, int y) + { + this.x = x; + this.y = y; + return this; + } + public void addTo(TurtlePanel panel) + { + panel.addPaintable(this); + } + @Override + public void paint(Graphics2D g, JPanel caller) + { + Font font = g.getFont(); + Font font2 = new Font(font.getName(), font.getStyle() | Font.BOLD, font.getSize()); + g.setFont(font2); + g.drawString(string, x, y); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.java b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.java new file mode 100644 index 00000000..8f768345 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.java @@ -0,0 +1,119 @@ +package org.teachingextensions.logo.tests; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.UseReporter; +import org.approvaltests.reporters.windows.TortoiseTextDiffReporter; + +import com.spun.util.StringUtils; +import com.spun.util.Tuple; +import com.spun.util.io.FileUtils; +import com.spun.util.tests.TestUtils; +import com.spun.util.velocity.ContextAware.ContextAwareMap; +import com.spun.util.velocity.VelocityParser; + +@UseReporter(TortoiseTextDiffReporter.class) +public class ColorGeneration extends TestCase +{ + public void testGeneration() throws Exception + { + HashMap>> loadColors = loadColors(); + Approvals.verify(generateColors(loadColors, "colors.java.template")); + } + public void testHtmlDisplay() throws Exception + { + HashMap>> loadColors = loadColors(); + Approvals.verifyHtml(generateColors(loadColors, "colors.html")); + } + public void ptestSortingDisplay() throws Exception + { + HashMap>> loadColors = loadColors(); + TestUtils.displayText(generateColors(loadColors, "colors.sorted.txt")); + } + private HashMap>> loadColors() + { + HashMap>> colors = new HashMap>>(); + String[] split = FileUtils.readFromClassPath(getClass(), "colors.txt").split("\n"); + String currentColor = ""; + for (String line : split) + { + String[] parts = StringUtils.stripWhiteSpace(line).split(" "); + //System.out.println(line); + if (parts.length == 1) + { + currentColor = parts[0]; + } + else + { + add(colors, currentColor, parts[0], parts[1]); + } + } + return colors; + } + private String generateColors(HashMap>> colors, String template) + { + ContextAwareMap aware = new ContextAwareMap("colors", colors); + aware.put("finder", this); + Object[] keys = colors.keySet().toArray(); + Arrays.sort(keys); + aware.put("keys", keys); + return VelocityParser.parseFromClassPath(this.getClass(), template, aware); + } + public static String getOtherColors(HashMap>> colors, String key, String color) + { + String out = ""; + for (Entry>> entry : colors.entrySet()) + { + if (!entry.getKey().equals(key)) + { + if (containsColor(entry.getValue(), color)) + { + out += entry.getKey() + ", "; + } + } + } + return out; + } + private static boolean containsColor(List> value, String color) + { + for (Tuple tuple : value) + { + if (color.equals(tuple.getFirst())) { return true; } + } + return false; + } + private void add(HashMap>> colors, String colorGroup, String name, + String hexValue) + { + List> list = colors.get(colorGroup); + if (list == null) + { + list = new ArrayList>(); + colors.put(colorGroup, list); + } + list.add(new Tuple(name, hexValue)); + Collections.sort(list, new BrightnessComparator()); + } + public class BrightnessComparator implements Comparator> + { + @Override + public int compare(Tuple o1, Tuple o2) + { + Color c1 = Color.decode(o1.getSecond()); + Color c2 = Color.decode(o2.getSecond()); + Integer b1 = c1.getGreen() + c1.getRed() + c1.getBlue(); + Integer b2 = c2.getGreen() + c2.getRed() + c2.getBlue(); + return b1.compareTo(b2); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testGeneration.approved.txt b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testGeneration.approved.txt new file mode 100644 index 00000000..48019ffa --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testGeneration.approved.txt @@ -0,0 +1,859 @@ +package org.teachingextensions.logo; + +import java.awt.Color; + +import com.spun.util.NumberUtils; + +/** + * Every color under the + * rainbow, + * and different ways to get them. + */ + public class Colors +{ +public static class Blues + { + /** + * The color Navy + *
 
+ **/ + public static final Color Navy = Color.decode("#000080"); + /** + * The color DarkBlue + *
 
+ **/ + public static final Color DarkBlue = Color.decode("#00008B"); + /** + * The color MidnightBlue + *
 
+ **/ + public static final Color MidnightBlue = Color.decode("#191970"); + /** + * The color MediumBlue + *
 
+ **/ + public static final Color MediumBlue = Color.decode("#0000CD"); + /** + * The color Blue + *
 
+ **/ + public static final Color Blue = Color.decode("#0000FF"); + /** + * The color Teal + *
 
+ **/ + public static final Color Teal = Color.decode("#008080"); + /** + * The color DarkSlateBlue + *
 
+ **/ + public static final Color DarkSlateBlue = Color.decode("#483D8B"); + /** + * The color DarkCyan + *
 
+ **/ + public static final Color DarkCyan = Color.decode("#008B8B"); + /** + * The color SteelBlue + *
 
+ **/ + public static final Color SteelBlue = Color.decode("#4682B4"); + /** + * The color RoyalBlue + *
 
+ **/ + public static final Color RoyalBlue = Color.decode("#4169E1"); + /** + * The color SlateBlue + *
 
+ **/ + public static final Color SlateBlue = Color.decode("#6A5ACD"); + /** + * The color CadetBlue + *
 
+ **/ + public static final Color CadetBlue = Color.decode("#5F9EA0"); + /** + * The color DarkTurquoise + *
 
+ **/ + public static final Color DarkTurquoise = Color.decode("#00CED1"); + /** + * The color DodgerBlue + *
 
+ **/ + public static final Color DodgerBlue = Color.decode("#1E90FF"); + /** + * The color DeepSkyBlue + *
 
+ **/ + public static final Color DeepSkyBlue = Color.decode("#00BFFF"); + /** + * The color MediumSlateBlue + *
 
+ **/ + public static final Color MediumSlateBlue = Color.decode("#7B68EE"); + /** + * The color MediumTurquoise + *
 
+ **/ + public static final Color MediumTurquoise = Color.decode("#48D1CC"); + /** + * The color CornflowerBlue + *
 
+ **/ + public static final Color CornflowerBlue = Color.decode("#6495ED"); + /** + * The color Turquoise + *
 
+ **/ + public static final Color Turquoise = Color.decode("#40E0D0"); + /** + * The color Aqua + *
 
+ **/ + public static final Color Aqua = Color.decode("#00FFFF"); + /** + * The color Cyan + *
 
+ **/ + public static final Color Cyan = Color.decode("#00FFFF"); + /** + * The color SkyBlue + *
 
+ **/ + public static final Color SkyBlue = Color.decode("#87CEEB"); + /** + * The color LightSkyBlue + *
 
+ **/ + public static final Color LightSkyBlue = Color.decode("#87CEFA"); + /** + * The color Aquamarine + *
 
+ **/ + public static final Color Aquamarine = Color.decode("#7FFFD4"); + /** + * The color LightSteelBlue + *
 
+ **/ + public static final Color LightSteelBlue = Color.decode("#B0C4DE"); + /** + * The color LightBlue + *
 
+ **/ + public static final Color LightBlue = Color.decode("#ADD8E6"); + /** + * The color PowderBlue + *
 
+ **/ + public static final Color PowderBlue = Color.decode("#B0E0E6"); + /** + * The color PaleTurquoise + *
 
+ **/ + public static final Color PaleTurquoise = Color.decode("#AFEEEE"); + /** + * The color LightCyan + *
 
+ **/ + public static final Color LightCyan = Color.decode("#E0FFFF"); + /** + * The color AliceBlue + *
 
+ **/ + public static final Color AliceBlue = Color.decode("#F0F8FF"); + /** + * The color Azure + *
 
+ **/ + public static final Color Azure = Color.decode("#F0FFFF"); + } + public static class Browns + { + /** + * The color Maroon + *
 
+ **/ + public static final Color Maroon = Color.decode("#800000"); + /** + * The color SaddleBrown + *
 
+ **/ + public static final Color SaddleBrown = Color.decode("#8B4513"); + /** + * The color Brown + *
 
+ **/ + public static final Color Brown = Color.decode("#A52A2A"); + /** + * The color Sienna + *
 
+ **/ + public static final Color Sienna = Color.decode("#A0522D"); + /** + * The color DarkGoldenrod + *
 
+ **/ + public static final Color DarkGoldenrod = Color.decode("#B8860B"); + /** + * The color Chocolate + *
 
+ **/ + public static final Color Chocolate = Color.decode("#D2691E"); + /** + * The color Peru + *
 
+ **/ + public static final Color Peru = Color.decode("#CD853F"); + /** + * The color Goldenrod + *
 
+ **/ + public static final Color Goldenrod = Color.decode("#DAA520"); + /** + * The color RosyBrown + *
 
+ **/ + public static final Color RosyBrown = Color.decode("#BC8F8F"); + /** + * The color SandyBrown + *
 
+ **/ + public static final Color SandyBrown = Color.decode("#F4A460"); + /** + * The color Tan + *
 
+ **/ + public static final Color Tan = Color.decode("#D2B48C"); + /** + * The color BurlyWood + *
 
+ **/ + public static final Color BurlyWood = Color.decode("#DEB887"); + /** + * The color Wheat + *
 
+ **/ + public static final Color Wheat = Color.decode("#F5DEB3"); + /** + * The color NavajoWhite + *
 
+ **/ + public static final Color NavajoWhite = Color.decode("#FFDEAD"); + /** + * The color Bisque + *
 
+ **/ + public static final Color Bisque = Color.decode("#FFE4C4"); + /** + * The color BlanchedAlmond + *
 
+ **/ + public static final Color BlanchedAlmond = Color.decode("#FFEBCD"); + /** + * The color Cornsilk + *
 
+ **/ + public static final Color Cornsilk = Color.decode("#FFF8DC"); + } + public static class Grays + { + /** + * The color Black + *
 
+ **/ + public static final Color Black = Color.decode("#000000"); + /** + * The color DarkSlateGray + *
 
+ **/ + public static final Color DarkSlateGray = Color.decode("#2F4F4F"); + /** + * The color DimGray + *
 
+ **/ + public static final Color DimGray = Color.decode("#696969"); + /** + * The color Gray + *
 
+ **/ + public static final Color Gray = Color.decode("#808080"); + /** + * The color SlateGray + *
 
+ **/ + public static final Color SlateGray = Color.decode("#708090"); + /** + * The color LightSlateGray + *
 
+ **/ + public static final Color LightSlateGray = Color.decode("#778899"); + /** + * The color DarkGray + *
 
+ **/ + public static final Color DarkGray = Color.decode("#A9A9A9"); + /** + * The color Silver + *
 
+ **/ + public static final Color Silver = Color.decode("#C0C0C0"); + /** + * The color LightGray + *
 
+ **/ + public static final Color LightGray = Color.decode("#D3D3D3"); + /** + * The color Gainsboro + *
 
+ **/ + public static final Color Gainsboro = Color.decode("#DCDCDC"); + } + public static class Greens + { + /** + * The color DarkGreen + *
 
+ **/ + public static final Color DarkGreen = Color.decode("#006400"); + /** + * The color Green + *
 
+ **/ + public static final Color Green = Color.decode("#008000"); + /** + * The color ForestGreen + *
 
+ **/ + public static final Color ForestGreen = Color.decode("#228B22"); + /** + * The color DarkOliveGreen + *
 
+ **/ + public static final Color DarkOliveGreen = Color.decode("#556B2F"); + /** + * The color Lime + *
 
+ **/ + public static final Color Lime = Color.decode("#00FF00"); + /** + * The color Olive + *
 
+ **/ + public static final Color Olive = Color.decode("#808000"); + /** + * The color Teal + *
 
+ **/ + public static final Color Teal = Color.decode("#008080"); + /** + * The color SeaGreen + *
 
+ **/ + public static final Color SeaGreen = Color.decode("#2E8B57"); + /** + * The color DarkCyan + *
 
+ **/ + public static final Color DarkCyan = Color.decode("#008B8B"); + /** + * The color OliveDrab + *
 
+ **/ + public static final Color OliveDrab = Color.decode("#6B8E23"); + /** + * The color LimeGreen + *
 
+ **/ + public static final Color LimeGreen = Color.decode("#32CD32"); + /** + * The color MediumSeaGreen + *
 
+ **/ + public static final Color MediumSeaGreen = Color.decode("#3CB371"); + /** + * The color LawnGreen + *
 
+ **/ + public static final Color LawnGreen = Color.decode("#7CFC00"); + /** + * The color LightSeaGreen + *
 
+ **/ + public static final Color LightSeaGreen = Color.decode("#20B2AA"); + /** + * The color Chartreuse + *
 
+ **/ + public static final Color Chartreuse = Color.decode("#7FFF00"); + /** + * The color SpringGreen + *
 
+ **/ + public static final Color SpringGreen = Color.decode("#00FF7F"); + /** + * The color MediumSpringGreen + *
 
+ **/ + public static final Color MediumSpringGreen = Color.decode("#00FA9A"); + /** + * The color YellowGreen + *
 
+ **/ + public static final Color YellowGreen = Color.decode("#9ACD32"); + /** + * The color DarkTurquoise + *
 
+ **/ + public static final Color DarkTurquoise = Color.decode("#00CED1"); + /** + * The color DarkSeaGreen + *
 
+ **/ + public static final Color DarkSeaGreen = Color.decode("#8FBC8F"); + /** + * The color GreenYellow + *
 
+ **/ + public static final Color GreenYellow = Color.decode("#ADFF2F"); + /** + * The color MediumAquamarine + *
 
+ **/ + public static final Color MediumAquamarine = Color.decode("#66CDAA"); + /** + * The color MediumTurquoise + *
 
+ **/ + public static final Color MediumTurquoise = Color.decode("#48D1CC"); + /** + * The color Turquoise + *
 
+ **/ + public static final Color Turquoise = Color.decode("#40E0D0"); + /** + * The color LightGreen + *
 
+ **/ + public static final Color LightGreen = Color.decode("#90EE90"); + /** + * The color PaleGreen + *
 
+ **/ + public static final Color PaleGreen = Color.decode("#98FB98"); + /** + * The color Aquamarine + *
 
+ **/ + public static final Color Aquamarine = Color.decode("#7FFFD4"); + /** + * The color PaleTurquoise + *
 
+ **/ + public static final Color PaleTurquoise = Color.decode("#AFEEEE"); + } + public static class Oranges + { + /** + * The color OrangeRed + *
 
+ **/ + public static final Color OrangeRed = Color.decode("#FF4500"); + /** + * The color DarkOrange + *
 
+ **/ + public static final Color DarkOrange = Color.decode("#FF8C00"); + /** + * The color Orange + *
 
+ **/ + public static final Color Orange = Color.decode("#FFA500"); + /** + * The color Tomato + *
 
+ **/ + public static final Color Tomato = Color.decode("#FF6347"); + /** + * The color Coral + *
 
+ **/ + public static final Color Coral = Color.decode("#FF7F50"); + /** + * The color LightSalmon + *
 
+ **/ + public static final Color LightSalmon = Color.decode("#FFA07A"); + } + public static class Pinks + { + /** + * The color MediumVioletRed + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color DeepPink + *
 
+ **/ + public static final Color DeepPink = Color.decode("#FF1493"); + /** + * The color PaleVioletRed + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color Fuchsia + *
 
+ **/ + public static final Color Fuchsia = Color.decode("#FF00FF"); + /** + * The color HotPink + *
 
+ **/ + public static final Color HotPink = Color.decode("#FF69B4"); + /** + * The color LightPink + *
 
+ **/ + public static final Color LightPink = Color.decode("#FFB6C1"); + /** + * The color Pink + *
 
+ **/ + public static final Color Pink = Color.decode("#FFC0CB"); + } + public static class Purples + { + /** + * The color Indigo + *
 
+ **/ + public static final Color Indigo = Color.decode("#4B0082"); + /** + * The color Purple + *
 
+ **/ + public static final Color Purple = Color.decode("#800080"); + /** + * The color DarkSlateBlue + *
 
+ **/ + public static final Color DarkSlateBlue = Color.decode("#483D8B"); + /** + * The color DarkMagenta + *
 
+ **/ + public static final Color DarkMagenta = Color.decode("#8B008B"); + /** + * The color MediumVioletRed + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color DarkViolet + *
 
+ **/ + public static final Color DarkViolet = Color.decode("#9400D3"); + /** + * The color SlateBlue + *
 
+ **/ + public static final Color SlateBlue = Color.decode("#6A5ACD"); + /** + * The color BlueViolet + *
 
+ **/ + public static final Color BlueViolet = Color.decode("#8A2BE2"); + /** + * The color DarkOrchid + *
 
+ **/ + public static final Color DarkOrchid = Color.decode("#9932CC"); + /** + * The color MediumSlateBlue + *
 
+ **/ + public static final Color MediumSlateBlue = Color.decode("#7B68EE"); + /** + * The color RosyBrown + *
 
+ **/ + public static final Color RosyBrown = Color.decode("#BC8F8F"); + /** + * The color MediumPurple + *
 
+ **/ + public static final Color MediumPurple = Color.decode("#9370DB"); + /** + * The color PaleVioletRed + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color MediumOrchid + *
 
+ **/ + public static final Color MediumOrchid = Color.decode("#BA55D3"); + /** + * The color Fuchsia + *
 
+ **/ + public static final Color Fuchsia = Color.decode("#FF00FF"); + /** + * The color Magenta + *
 
+ **/ + public static final Color Magenta = Color.decode("#FF00FF"); + /** + * The color Orchid + *
 
+ **/ + public static final Color Orchid = Color.decode("#DA70D6"); + /** + * The color Plum + *
 
+ **/ + public static final Color Plum = Color.decode("#DDA0DD"); + /** + * The color Violet + *
 
+ **/ + public static final Color Violet = Color.decode("#EE82EE"); + /** + * The color Thistle + *
 
+ **/ + public static final Color Thistle = Color.decode("#D8BFD8"); + /** + * The color Lavender + *
 
+ **/ + public static final Color Lavender = Color.decode("#E6E6FA"); + } + public static class Reds + { + /** + * The color DarkRed + *
 
+ **/ + public static final Color DarkRed = Color.decode("#8B0000"); + /** + * The color FireBrick + *
 
+ **/ + public static final Color FireBrick = Color.decode("#B22222"); + /** + * The color Red + *
 
+ **/ + public static final Color Red = Color.decode("#FF0000"); + /** + * The color Crimson + *
 
+ **/ + public static final Color Crimson = Color.decode("#DC143C"); + /** + * The color OrangeRed + *
 
+ **/ + public static final Color OrangeRed = Color.decode("#FF4500"); + /** + * The color MediumVioletRed + *
 
+ **/ + public static final Color MediumVioletRed = Color.decode("#C71585"); + /** + * The color IndianRed + *
 
+ **/ + public static final Color IndianRed = Color.decode("#CD5C5C"); + /** + * The color Tomato + *
 
+ **/ + public static final Color Tomato = Color.decode("#FF6347"); + /** + * The color PaleVioletRed + *
 
+ **/ + public static final Color PaleVioletRed = Color.decode("#DB7093"); + /** + * The color Salmon + *
 
+ **/ + public static final Color Salmon = Color.decode("#FA8072"); + /** + * The color LightCoral + *
 
+ **/ + public static final Color LightCoral = Color.decode("#F08080"); + /** + * The color DarkSalmon + *
 
+ **/ + public static final Color DarkSalmon = Color.decode("#E9967A"); + /** + * The color LightSalmon + *
 
+ **/ + public static final Color LightSalmon = Color.decode("#FFA07A"); + } + public static class Whites + { + /** + * The color AntiqueWhite + *
 
+ **/ + public static final Color AntiqueWhite = Color.decode("#FAEBD7"); + /** + * The color MistyRose + *
 
+ **/ + public static final Color MistyRose = Color.decode("#FFE4E1"); + /** + * The color Beige + *
 
+ **/ + public static final Color Beige = Color.decode("#F5F5DC"); + /** + * The color Linen + *
 
+ **/ + public static final Color Linen = Color.decode("#FAF0E6"); + /** + * The color OldLace + *
 
+ **/ + public static final Color OldLace = Color.decode("#FDF5E6"); + /** + * The color Honeydew + *
 
+ **/ + public static final Color Honeydew = Color.decode("#F0FFF0"); + /** + * The color WhiteSmoke + *
 
+ **/ + public static final Color WhiteSmoke = Color.decode("#F5F5F5"); + /** + * The color Seashell + *
 
+ **/ + public static final Color Seashell = Color.decode("#FFF5EE"); + /** + * The color LavenderBlush + *
 
+ **/ + public static final Color LavenderBlush = Color.decode("#FFF0F5"); + /** + * The color AliceBlue + *
 
+ **/ + public static final Color AliceBlue = Color.decode("#F0F8FF"); + /** + * The color FloralWhite + *
 
+ **/ + public static final Color FloralWhite = Color.decode("#FFFAF0"); + /** + * The color MintCream + *
 
+ **/ + public static final Color MintCream = Color.decode("#F5FFFA"); + /** + * The color Azure + *
 
+ **/ + public static final Color Azure = Color.decode("#F0FFFF"); + /** + * The color Ivory + *
 
+ **/ + public static final Color Ivory = Color.decode("#FFFFF0"); + /** + * The color GhostWhite + *
 
+ **/ + public static final Color GhostWhite = Color.decode("#F8F8FF"); + /** + * The color Snow + *
 
+ **/ + public static final Color Snow = Color.decode("#FFFAFA"); + /** + * The color White + *
 
+ **/ + public static final Color White = Color.decode("#FFFFFF"); + } + public static class Yellows + { + /** + * The color DarkGoldenrod + *
 
+ **/ + public static final Color DarkGoldenrod = Color.decode("#B8860B"); + /** + * The color Goldenrod + *
 
+ **/ + public static final Color Goldenrod = Color.decode("#DAA520"); + /** + * The color Gold + *
 
+ **/ + public static final Color Gold = Color.decode("#FFD700"); + /** + * The color DarkKhaki + *
 
+ **/ + public static final Color DarkKhaki = Color.decode("#BDB76B"); + /** + * The color Yellow + *
 
+ **/ + public static final Color Yellow = Color.decode("#FFFF00"); + /** + * The color Khaki + *
 
+ **/ + public static final Color Khaki = Color.decode("#F0E68C"); + /** + * The color PaleGoldenrod + *
 
+ **/ + public static final Color PaleGoldenrod = Color.decode("#EEE8AA"); + /** + * The color PeachPuff + *
 
+ **/ + public static final Color PeachPuff = Color.decode("#FFDAB9"); + /** + * The color Moccasin + *
 
+ **/ + public static final Color Moccasin = Color.decode("#FFE4B5"); + /** + * The color PapayaWhip + *
 
+ **/ + public static final Color PapayaWhip = Color.decode("#FFEFD5"); + /** + * The color LemonChiffon + *
 
+ **/ + public static final Color LemonChiffon = Color.decode("#FFFACD"); + /** + * The color LightGoldenrodYellow + *
 
+ **/ + public static final Color LightGoldenrodYellow = Color.decode("#FAFAD2"); + /** + * The color LightYellow + *
 
+ **/ + public static final Color LightYellow = Color.decode("#FFFFE0"); + } + } \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testHtmlDisplay.approved.html b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testHtmlDisplay.approved.html new file mode 100644 index 00000000..e54090a0 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/ColorGeneration.testHtmlDisplay.approved.html @@ -0,0 +1,702 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Blues
Navy
DarkBlue
MidnightBlue
MediumBlue
Blue
TealGreens,
DarkSlateBluePurples,
DarkCyanGreens,
SteelBlue
RoyalBlue
SlateBluePurples,
CadetBlue
DarkTurquoiseGreens,
DodgerBlue
DeepSkyBlue
MediumSlateBluePurples,
MediumTurquoiseGreens,
CornflowerBlue
TurquoiseGreens,
Aqua
Cyan
SkyBlue
LightSkyBlue
AquamarineGreens,
LightSteelBlue
LightBlue
PowderBlue
PaleTurquoiseGreens,
LightCyan
AliceBlueWhites,
AzureWhites,
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Browns
Maroon
SaddleBrown
Brown
Sienna
DarkGoldenrodYellows,
Chocolate
Peru
GoldenrodYellows,
RosyBrownPurples,
SandyBrown
Tan
BurlyWood
Wheat
NavajoWhite
Bisque
BlanchedAlmond
Cornsilk
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Grays
Black
DarkSlateGray
DimGray
Gray
SlateGray
LightSlateGray
DarkGray
Silver
LightGray
Gainsboro
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Greens
DarkGreen
Green
ForestGreen
DarkOliveGreen
Lime
Olive
TealBlues,
SeaGreen
DarkCyanBlues,
OliveDrab
LimeGreen
MediumSeaGreen
LawnGreen
LightSeaGreen
Chartreuse
SpringGreen
MediumSpringGreen
YellowGreen
DarkTurquoiseBlues,
DarkSeaGreen
GreenYellow
MediumAquamarine
MediumTurquoiseBlues,
TurquoiseBlues,
LightGreen
PaleGreen
AquamarineBlues,
PaleTurquoiseBlues,
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Oranges
OrangeRedReds,
DarkOrange
Orange
TomatoReds,
Coral
LightSalmonReds,
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pinks
MediumVioletRedReds, Purples,
DeepPink
PaleVioletRedReds, Purples,
FuchsiaPurples,
HotPink
LightPink
Pink
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Purples
Indigo
Purple
DarkSlateBlueBlues,
DarkMagenta
MediumVioletRedReds, Pinks,
DarkViolet
SlateBlueBlues,
BlueViolet
DarkOrchid
MediumSlateBlueBlues,
RosyBrownBrowns,
MediumPurple
PaleVioletRedReds, Pinks,
MediumOrchid
FuchsiaPinks,
Magenta
Orchid
Plum
Violet
Thistle
Lavender
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Reds
DarkRed
FireBrick
Red
Crimson
OrangeRedOranges,
MediumVioletRedPinks, Purples,
IndianRed
TomatoOranges,
PaleVioletRedPinks, Purples,
Salmon
LightCoral
DarkSalmon
LightSalmonOranges,
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Whites
AntiqueWhite
MistyRose
Beige
Linen
OldLace
Honeydew
WhiteSmoke
Seashell
LavenderBlush
AliceBlueBlues,
FloralWhite
MintCream
AzureBlues,
Ivory
GhostWhite
Snow
White
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Yellows
DarkGoldenrodBrowns,
GoldenrodBrowns,
Gold
DarkKhaki
Yellow
Khaki
PaleGoldenrod
PeachPuff
Moccasin
PapayaWhip
LemonChiffon
LightGoldenrodYellow
LightYellow
diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/ColorsTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/ColorsTest.java new file mode 100644 index 00000000..fffe4e5b --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/ColorsTest.java @@ -0,0 +1,14 @@ +package org.teachingextensions.logo.tests; + +import junit.framework.TestCase; + +import org.teachingextensions.logo.Colors; + +public class ColorsTest extends TestCase +{ + public void testTransparency() throws Exception + { + assertEquals(0, Colors.calculateTransparency(100)); + assertEquals(255, Colors.calculateTransparency(0)); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.java b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.java new file mode 100644 index 00000000..3fc822c6 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.java @@ -0,0 +1,207 @@ +package org.teachingextensions.logo.tests; + +import java.awt.Color; +import java.util.HashMap; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DelayedClipboardReporter; +import org.approvaltests.reporters.FileLauncherReporter; +import org.approvaltests.reporters.UseReporter; +import org.teachingextensions.logo.Colors; +import org.teachingextensions.logo.Turtle; +import org.teachingextensions.logo.Wheel; + +@UseReporter({FileLauncherReporter.class, DelayedClipboardReporter.class}) +public class RecipeTests extends TestCase +{ + public void testSimpleSquare() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + turtle.show(); + for (int i = 0; i < 4; i++) + { + turtle.setPenColor(Colors.Blues.SteelBlue); + turtle.move(50); + turtle.turn(90); + } + Approvals.verify(turtle.getImage()); + } + public void testCircle() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + turtle.show(); + int sides = 35; + for (int i = 0; i < sides; i++) + { + turtle.setPenColor(Colors.Reds.OrangeRed); + turtle.move(18); + turtle.turn(360.0 / sides); + } + Approvals.verify(turtle.getImage()); + } + public void testSpiral() throws Exception + { + Color color = Colors.Purples.Violet; + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + for (int i = 0; i < 25; i++) + { + turtle.setPenColor(color); + turtle.move(3 * i); + turtle.turn(90); + color = Colors.darken(color); + } + Approvals.verify(turtle.getImage()); + } + public void testFourSquare() throws Exception + { + Turtle turtle = new Turtle(); + Colors.mockRandom(); + turtle.setSpeed(Turtle.TEST_SPEED); + for (int i = 0; i < 4; i++) + { + drawSquare(turtle); + turtle.turn(90); + } + Approvals.verify(turtle.getImage()); + } + private void drawSquare(Turtle turtle) + { + for (int i = 0; i < 4; i++) + { + turtle.setPenColor(Colors.getRandomColor()); + turtle.move(50); + turtle.turn(90); + } + } + public void testDigiGirlzFlower() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + turtle.show(); + turtle.getBackgroundWindow().setColor(Colors.Grays.Silver); + Wheel palette = setupColors(); + turtle.setPenWidth(3); + for (int i = 0; i < 15; i++) + { + drawOctogon(turtle, palette); + turtle.turn(360 / 15); + } + Approvals.verify(turtle.getImage()); + } + private void drawOctogon(Turtle turtle, Wheel palette) + { + for (int i = 0; i < 8; i++) + { + turtle.setPenColor(palette.next()); + turtle.move(50); + turtle.turn(360 / 8); + } + } + private Wheel setupColors() + { + Color[] colors = {Colors.Reds.Red, Colors.Oranges.DarkOrange, Colors.Yellows.Gold, Colors.Yellows.Yellow}; + Wheel wheel = new Wheel(); + wheel.add(colors[0]); + wheel.add(colors[1]); + wheel.add(colors[2]); + wheel.add(colors[3]); + wheel.add(colors[3]); + wheel.add(colors[2]); + wheel.add(colors[1]); + wheel.add(colors[0]); + return wheel; + } + public void testTriangleShell() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + turtle.show(); + int number = 60; + int length = 0; + for (int i = 0; i < number; i++) + { + turtle.setPenColor(Colors.getRandomColor()); + length += 4; + drawTriangle(turtle, length); + turtle.turn(360 / number); + } + Approvals.verify(turtle.getImage()); + } + private void drawTriangle(Turtle turtle, int length) + { + int sides = 3; + for (int i = 0; i < sides; i++) + { + turtle.move(length); + turtle.turn(360 / sides); + } + } + public void testKnottedRing() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + Wheel wheel = new Wheel(Colors.Pinks.HotPink, Colors.Reds.Red, Colors.Purples.Fuchsia, + Colors.Oranges.OrangeRed, Colors.Pinks.DeepPink, Colors.Pinks.MediumVioletRed, Colors.Reds.Crimson, + Colors.Oranges.Tomato); + for (int i = 0; i < 30; i++) + { + turtle.setPenColor(wheel.next()); + drawOctogonWithOverlap(turtle); + turtle.turn(360 / 30); + turtle.turn(5); + } + Approvals.verify(turtle.getImage()); + } + private void drawOctogonWithOverlap(Turtle turtle) + { + for (int i = 0; i < 9; i++) + { + turtle.move(110); + turtle.turn(360 / 8); + } + } + public void testTurtleTree() throws Exception + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + turtle.show(); + turtle.getBackgroundWindow().setColor(Colors.Grays.Black); + drawBranch(turtle, 60); + Approvals.verify(turtle.getImage()); + } + private void drawBranch(Turtle turtle, int length) + { + pickColorForBranchLenth(turtle, length); + turtle.move(length); + drawLowerBranch(turtle, length - 10); + pickColorForBranchLenth(turtle, length); + turtle.move(-length); + } + private void drawLowerBranch(Turtle turtle, int length) + { + if (length > 0) + { + turtle.turn(30); + drawBranch(turtle, length); + turtle.turn(-60); + drawBranch(turtle, length); + turtle.turn(30); + } + } + private void pickColorForBranchLenth(Turtle turtle, int length) + { + HashMap map = new HashMap(); + map.put(10, Colors.Greens.LimeGreen); + map.put(20, Colors.Greens.ForestGreen); + map.put(30, Colors.Greens.DarkGreen); + map.put(40, Colors.Greens.Olive); + map.put(50, Colors.Browns.Sienna); + map.put(60, Colors.Browns.SaddleBrown); + turtle.setPenColor(map.get(length)); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testCircle.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testCircle.approved.png new file mode 100644 index 00000000..9a31039c Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testCircle.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testDigiGirlzFlower.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testDigiGirlzFlower.approved.png new file mode 100644 index 00000000..6646fef1 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testDigiGirlzFlower.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testFourSquare.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testFourSquare.approved.png new file mode 100644 index 00000000..a7e9361a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testFourSquare.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testKnottedRing.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testKnottedRing.approved.png new file mode 100644 index 00000000..c85abeee Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testKnottedRing.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSimpleSquare.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSimpleSquare.approved.png new file mode 100644 index 00000000..5740cf9c Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSimpleSquare.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSpiral.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSpiral.approved.png new file mode 100644 index 00000000..21392225 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testSpiral.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTriangleShell.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTriangleShell.approved.png new file mode 100644 index 00000000..c88a35e1 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTriangleShell.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTurtleTree.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTurtleTree.approved.png new file mode 100644 index 00000000..4a93cf5f Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/RecipeTests.testTurtleTree.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.java new file mode 100644 index 00000000..67627414 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.java @@ -0,0 +1,38 @@ +package org.teachingextensions.logo.tests; + +import junit.framework.TestCase; + +import org.approvaltests.reporters.ClipboardReporter; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.teachingextensions.logo.Colors; +import org.teachingextensions.logo.Tortoise; +import org.teachingextensions.logo.Turtle; +import org.teachingextensions.logo.utils.TortoiseUtils; + +@UseReporter({DiffReporter.class, ClipboardReporter.class}) +public class TortoiseTest extends TestCase +{ + public void testSimpleSquare() throws Exception + { + Tortoise.setSpeed(Turtle.TEST_SPEED); + Tortoise.show(); + int sides = 4; + for (int i = 1; i <= sides; i++) + { + Tortoise.setPenColor(Colors.Blues.Blue); + Tortoise.move(50); + Tortoise.turn(90); + } + TortoiseUtils.verify(); + } + public void testBigWidth() throws Exception + { + Tortoise.setSpeed(Turtle.TEST_SPEED); + Tortoise.show(); + Tortoise.setPenColor(Colors.Browns.Maroon); + Tortoise.setPenWidth(100); + Tortoise.move(10); + TortoiseUtils.verify(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testBigWidth.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testBigWidth.approved.png new file mode 100644 index 00000000..6811df49 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testBigWidth.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testSimpleSquare.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testSimpleSquare.approved.png new file mode 100644 index 00000000..b5647b3a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TortoiseTest.testSimpleSquare.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.java new file mode 100644 index 00000000..52ecff33 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.java @@ -0,0 +1,22 @@ +package org.teachingextensions.logo.tests; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.ClipboardReporter; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.teachingextensions.logo.Turtle; + +@UseReporter({ClipboardReporter.class, DiffReporter.class}) +public class TurtlePanelTest extends TestCase +{ + public void testImageForBackground() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.move(50); + turtle.getBackgroundWindow().setBackgroundImage( + "http://teachingkidsprogramming.org/blog/wp-content/uploads/teachingKidsProgramming_logo_sm.png"); + Approvals.verify(turtle.getImage()); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.testImageForBackground.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.testImageForBackground.approved.png new file mode 100644 index 00000000..0285c523 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtlePanelTest.testImageForBackground.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.java new file mode 100644 index 00000000..e70a414d --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.java @@ -0,0 +1,132 @@ +package org.teachingextensions.logo.tests; + +import java.awt.Color; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DelayedClipboardReporter; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.lambda.functions.Function1; +import org.teachingextensions.logo.Colors; +import org.teachingextensions.logo.Turtle; +import org.teachingextensions.logo.Wheel; + +@UseReporter({DiffReporter.class, DelayedClipboardReporter.class}) +public class TurtleTest extends TestCase +{ + public void testShow() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + Approvals.verify(turtle.getImage()); + } + public void testRotate() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.turn(90); + Approvals.verify(turtle.getImage()); + } + public void testRotate45() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.turn(45); + Approvals.verify(turtle.getImage()); + assertEquals(45.0, turtle.getAngleInDegrees(), 0.02); + } + public void testRotate45CounterClockwise() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.turn(-45); + Approvals.verify(turtle.getImage()); + } + public void testMove() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.move(50); + Approvals.verify(turtle.getImage()); + } + public void testMove45DegreesLeft() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.turn(-45); + turtle.move(50); + Approvals.verify(turtle.getImage()); + } + public void testDelta() throws Exception + { + String out = ""; + for (int i = 0; i < 9; i++) + { + double deltaY = Turtle.getDeltaY(5, i * 45.0); + double deltaX = Turtle.getDeltaX(5, i * 45.0); + out += String.format("%s=>[%s, %s]\r\n", i * 45, deltaX, deltaY); + } + Approvals.verify(out); + } + public void testCalculateAngle() throws Exception + { + assertEquals(-90.0, Turtle.angleCalculator(0, 0, -1, 0), 0.005); + assertEquals(90.0, Turtle.angleCalculator(0, 0, 1, 0), 0.005); + } + public void testPentagonCrazy() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + Wheel wheel = new Wheel(); + wheel.add(Colors.Blues.SteelBlue); + wheel.add(Colors.Purples.DarkMagenta); + wheel.add(Colors.Blues.DarkSlateBlue); + wheel.add(Colors.Purples.Indigo); + wheel.add(Colors.Purples.DarkOrchid); + Wheel thickness = new Wheel(1, 2, 3); + for (int i = 0; i < 200; i++) + { + turtle.setPenColor(wheel.next()); + turtle.setPenWidth(thickness.next()); + turtle.move(i + 1); + turtle.turn(360 / 5); + turtle.turn(1); + } + Approvals.verify(turtle.getImage()); + } + public void testPenDown() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + for (int i = 0; i < 3; i++) + { + turtle.move(10); + turtle.penUp(); + turtle.move(10); + turtle.penDown(); + } + Approvals.verify(turtle.getImage()); + } + public void testHide() throws Exception + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.move(50); + turtle.hide(); + Approvals.verify(turtle.getImage()); + } + public void testSpeed() throws Exception + { + Integer[] speeds = {-5, 5, 15, Turtle.TEST_SPEED}; + Approvals.verifyAll("Speeds", speeds, new Function1() + { + @Override + public String call(Integer speed) + { + try + { + Turtle turtle = TurtleUtils.getTurtle(); + turtle.setSpeed(speed); + return speed + " => " + turtle.getSpeed(); + } + catch (Exception e) + { + return speed + " => " + e.getMessage(); + } + } + }); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testDelta.approved.txt b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testDelta.approved.txt new file mode 100644 index 00000000..fb6fc382 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testDelta.approved.txt @@ -0,0 +1,9 @@ +0=>[0.0, -5.0] +45=>[3.5355339059327373, -3.5355339059327378] +90=>[5.0, -3.061616997868383E-16] +135=>[3.5355339059327378, 3.5355339059327373] +180=>[6.123233995736766E-16, 5.0] +225=>[-3.5355339059327373, 3.5355339059327386] +270=>[-5.0, 9.184850993605148E-16] +315=>[-3.5355339059327386, -3.535533905932737] +360=>[-1.2246467991473533E-15, -5.0] diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testHide.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testHide.approved.png new file mode 100644 index 00000000..374bb4db Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testHide.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove.approved.png new file mode 100644 index 00000000..b7a0dd13 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove45DegreesLeft.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove45DegreesLeft.approved.png new file mode 100644 index 00000000..db98adf9 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testMove45DegreesLeft.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPenDown.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPenDown.approved.png new file mode 100644 index 00000000..d5bad72f Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPenDown.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPentagonCrazy.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPentagonCrazy.approved.png new file mode 100644 index 00000000..604b51c2 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testPentagonCrazy.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate.approved.png new file mode 100644 index 00000000..b3661b0e Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45.approved.png new file mode 100644 index 00000000..080e0b53 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45CounterClockwise.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45CounterClockwise.approved.png new file mode 100644 index 00000000..67961597 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testRotate45CounterClockwise.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testShow.approved.png b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testShow.approved.png new file mode 100644 index 00000000..ce2714f7 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testShow.approved.png differ diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testSpeed.approved.txt b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testSpeed.approved.txt new file mode 100644 index 00000000..28a7fc39 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleTest.testSpeed.approved.txt @@ -0,0 +1,11 @@ +Speeds + + +-5 => I call shenanigans!!! +The speed '-5' is not between the acceptable range of [1-10] +Perhaps you should read the documentation +5 => 5 +15 => I call shenanigans!!! +The speed '15' is not between the acceptable range of [1-10] +Perhaps you should read the documentation +-2147483648 => -2147483648 diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/TurtleUtils.java b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleUtils.java new file mode 100644 index 00000000..9c0930ae --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/TurtleUtils.java @@ -0,0 +1,14 @@ +package org.teachingextensions.logo.tests; + +import org.teachingextensions.logo.Turtle; + +public class TurtleUtils +{ + + public static Turtle getTurtle() + { + Turtle turtle = new Turtle(); + turtle.setSpeed(Turtle.TEST_SPEED); + return turtle; + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/VirtualProctorTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/VirtualProctorTest.java new file mode 100644 index 00000000..4a17bc1d --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/VirtualProctorTest.java @@ -0,0 +1,16 @@ +package org.teachingextensions.logo.tests; + +import junit.framework.TestCase; + +import org.teachingextensions.utils.VirtualProctor; + +public class VirtualProctorTest extends TestCase +{ + public void testSetName() throws Exception + { + VirtualProctor.internals.resetName(); + assertEquals("WIN-J2264SMJD6Q", VirtualProctor.internals.getName()); + VirtualProctor.setName("Lynn"); + assertEquals("Lynn", VirtualProctor.internals.getName()); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.java b/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.java new file mode 100644 index 00000000..12b8a1dd --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.java @@ -0,0 +1,26 @@ +package org.teachingextensions.logo.tests; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.UseReporter; +import org.approvaltests.reporters.windows.TortoiseTextDiffReporter; +import org.teachingextensions.logo.Wheel; + +public class WheelTest extends TestCase +{ + @UseReporter(TortoiseTextDiffReporter.class) + public void testWheel() throws Exception + { + String out = ""; + Wheel wheel = new Wheel(); + wheel.add(4); + wheel.add(6); + wheel.add(8); + for (int i = 0; i < 7; i++) + { + out += wheel.next() + " - "; + } + Approvals.verify(out); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.testWheel.approved.txt b/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.testWheel.approved.txt new file mode 100644 index 00000000..31828fc7 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/WheelTest.testWheel.approved.txt @@ -0,0 +1 @@ +4 - 6 - 8 - 4 - 6 - 8 - 4 - \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/colors.cpp b/build/src/main/resources/org/teachingextensions/logo/tests/colors.cpp new file mode 100644 index 00000000..f7f63186 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/colors.cpp @@ -0,0 +1,13 @@ +#foreach($key in $colors.keySet()) + + #foreach($color in $commons.asArray($colors.get($key))) + + /// + /// This is the same as "$color.get().getFirst()" + /// + public static Primitive ${key}_$StringUtils.padNumber($color.getIndex(1),2)_$color.get().getFirst() + { + get { return new Primitive("$color.get().getFirst()"); } + } + #end + #end \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/colors.html b/build/src/main/resources/org/teachingextensions/logo/tests/colors.html new file mode 100644 index 00000000..bd22f562 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/colors.html @@ -0,0 +1,13 @@ +#foreach($key in $keys) + + + + + #foreach($color in $colors.get($key)) + + + + + #end +
$key
$color.getFirst()$finder.getOtherColors($colors, $key, $color.getFirst())
+#end diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/colors.java.template b/build/src/main/resources/org/teachingextensions/logo/tests/colors.java.template new file mode 100644 index 00000000..22828ed6 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/colors.java.template @@ -0,0 +1,26 @@ +package org.teachingextensions.logo; + +import java.awt.Color; + +import com.spun.util.NumberUtils; + +/** + * Every color under the + * rainbow, + * and different ways to get them. + */ + public class Colors +{ +#foreach($key in $keys) +public static class $key + { + #foreach($color in $colors.get($key)) + /** + * The color $color.getFirst() + *
 
+ **/ + public static final Color $color.getFirst() = Color.decode("$color.getSecond()"); + #end + } + #end + } \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/colors.sorted.txt b/build/src/main/resources/org/teachingextensions/logo/tests/colors.sorted.txt new file mode 100644 index 00000000..39f69815 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/colors.sorted.txt @@ -0,0 +1,6 @@ +#foreach($key in $keys) +$key +#foreach($color in $colors.get($key)) + $color.getFirst() $color.getSecond() +#end +#end diff --git a/build/src/main/resources/org/teachingextensions/logo/tests/colors.txt b/build/src/main/resources/org/teachingextensions/logo/tests/colors.txt new file mode 100644 index 00000000..f62762bd --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/tests/colors.txt @@ -0,0 +1,173 @@ +Blues + Navy #000080 + DarkBlue #00008B + MidnightBlue #191970 + MediumBlue #0000CD + Blue #0000FF + Teal #008080 + DarkSlateBlue #483D8B + DarkCyan #008B8B + SteelBlue #4682B4 + RoyalBlue #4169E1 + SlateBlue #6A5ACD + CadetBlue #5F9EA0 + DarkTurquoise #00CED1 + DodgerBlue #1E90FF + DeepSkyBlue #00BFFF + MediumSlateBlue #7B68EE + MediumTurquoise #48D1CC + CornflowerBlue #6495ED + Turquoise #40E0D0 + Aqua #00FFFF + Cyan #00FFFF + SkyBlue #87CEEB + LightSkyBlue #87CEFA + Aquamarine #7FFFD4 + LightSteelBlue #B0C4DE + LightBlue #ADD8E6 + PowderBlue #B0E0E6 + PaleTurquoise #AFEEEE + LightCyan #E0FFFF + AliceBlue #F0F8FF + Azure #F0FFFF +Browns + Maroon #800000 + SaddleBrown #8B4513 + Brown #A52A2A + Sienna #A0522D + DarkGoldenrod #B8860B + Chocolate #D2691E + Peru #CD853F + Goldenrod #DAA520 + RosyBrown #BC8F8F + SandyBrown #F4A460 + Tan #D2B48C + BurlyWood #DEB887 + Wheat #F5DEB3 + NavajoWhite #FFDEAD + Bisque #FFE4C4 + BlanchedAlmond #FFEBCD + Cornsilk #FFF8DC +Grays + Black #000000 + DarkSlateGray #2F4F4F + DimGray #696969 + Gray #808080 + SlateGray #708090 + LightSlateGray #778899 + DarkGray #A9A9A9 + Silver #C0C0C0 + LightGray #D3D3D3 + Gainsboro #DCDCDC +Greens + DarkGreen #006400 + Green #008000 + ForestGreen #228B22 + DarkOliveGreen #556B2F + Lime #00FF00 + Olive #808000 + Teal #008080 + SeaGreen #2E8B57 + DarkCyan #008B8B + OliveDrab #6B8E23 + LimeGreen #32CD32 + MediumSeaGreen #3CB371 + LawnGreen #7CFC00 + LightSeaGreen #20B2AA + Chartreuse #7FFF00 + SpringGreen #00FF7F + MediumSpringGreen #00FA9A + YellowGreen #9ACD32 + DarkTurquoise #00CED1 + DarkSeaGreen #8FBC8F + GreenYellow #ADFF2F + MediumAquamarine #66CDAA + MediumTurquoise #48D1CC + Turquoise #40E0D0 + LightGreen #90EE90 + PaleGreen #98FB98 + Aquamarine #7FFFD4 + PaleTurquoise #AFEEEE +Oranges + OrangeRed #FF4500 + DarkOrange #FF8C00 + Orange #FFA500 + Tomato #FF6347 + Coral #FF7F50 + LightSalmon #FFA07A +Pinks + MediumVioletRed #C71585 + DeepPink #FF1493 + PaleVioletRed #DB7093 + Fuchsia #FF00FF + HotPink #FF69B4 + LightPink #FFB6C1 + Pink #FFC0CB +Purples + Indigo #4B0082 + Purple #800080 + DarkSlateBlue #483D8B + DarkMagenta #8B008B + MediumVioletRed #C71585 + DarkViolet #9400D3 + SlateBlue #6A5ACD + BlueViolet #8A2BE2 + DarkOrchid #9932CC + MediumSlateBlue #7B68EE + RosyBrown #BC8F8F + MediumPurple #9370DB + PaleVioletRed #DB7093 + MediumOrchid #BA55D3 + Fuchsia #FF00FF + Magenta #FF00FF + Orchid #DA70D6 + Plum #DDA0DD + Violet #EE82EE + Thistle #D8BFD8 + Lavender #E6E6FA +Reds + DarkRed #8B0000 + FireBrick #B22222 + Red #FF0000 + Crimson #DC143C + OrangeRed #FF4500 + MediumVioletRed #C71585 + IndianRed #CD5C5C + Tomato #FF6347 + PaleVioletRed #DB7093 + Salmon #FA8072 + LightCoral #F08080 + DarkSalmon #E9967A + LightSalmon #FFA07A +Whites + AntiqueWhite #FAEBD7 + MistyRose #FFE4E1 + Beige #F5F5DC + Linen #FAF0E6 + OldLace #FDF5E6 + Honeydew #F0FFF0 + WhiteSmoke #F5F5F5 + Seashell #FFF5EE + LavenderBlush #FFF0F5 + AliceBlue #F0F8FF + FloralWhite #FFFAF0 + MintCream #F5FFFA + Azure #F0FFFF + Ivory #FFFFF0 + GhostWhite #F8F8FF + Snow #FFFAFA + White #FFFFFF +Yellows + DarkGoldenrod #B8860B + Goldenrod #DAA520 + Gold #FFD700 + DarkKhaki #BDB76B + Yellow #FFFF00 + Khaki #F0E68C + PaleGoldenrod #EEE8AA + PeachPuff #FFDAB9 + Moccasin #FFE4B5 + PapayaWhip #FFEFD5 + LemonChiffon #FFFACD + LightGoldenrodYellow #FAFAD2 + LightYellow #FFFFE0 \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.class b/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.class new file mode 100644 index 00000000..921ba544 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.java b/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.java new file mode 100644 index 00000000..7c656eeb --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/utils/Sounds.java @@ -0,0 +1,15 @@ +package org.teachingextensions.logo.utils; + +import java.awt.Toolkit; + +public class Sounds +{ + /** + * Plays a beep through your speakers. BEEP!
+ * Example: {@code Sounds.playBeep()} + */ + public static void playBeep() + { + Toolkit.getDefaultToolkit().beep(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.class b/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.class new file mode 100644 index 00000000..7e79784d Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.class differ diff --git a/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.java b/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.java new file mode 100644 index 00000000..a30dccc1 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/utils/TortoiseUtils.java @@ -0,0 +1,59 @@ +package org.teachingextensions.logo.utils; + +import org.approvaltests.Approvals; +import org.approvaltests.namer.ApprovalResults; +import org.teachingextensions.logo.Turtle; + +import com.spun.util.ObjectUtils; + +public class TortoiseUtils +{ + private static Turtle TURTLE = new Turtle(); + /** + * Captures an image of the result of your program and displays it to you + */ + public static void verify() + { + try + { + Approvals.verify(TURTLE.getImage()); + } + catch (Exception e) + { + throw ObjectUtils.throwAsError(e); + } + finally + { + TortoiseUtils.resetTurtle(); + } + } + public static void resetTurtle() + { + TURTLE = new Turtle(); + } + public static void setOrientation(int x, int y, int angle) + { + TURTLE.setX(x); + TURTLE.setY(y); + TURTLE.setAngleInDegrees(angle); + } + public static Turtle getTurtle() + { + return TURTLE; + } + public static void setTurtle(Turtle turtle) + { + TortoiseUtils.TURTLE = turtle; + } + public static void verifyForOs() + { + ApprovalResults.UniqueForOs(); + verify(); + } + public static void writeMessage(String string, int x, int y) + { + TURTLE.setX(x); + TURTLE.setY(y); + TURTLE.print(string); + } +} diff --git a/build/src/main/resources/org/teachingextensions/logo/utils/tests/SoundsDemo.java b/build/src/main/resources/org/teachingextensions/logo/utils/tests/SoundsDemo.java new file mode 100644 index 00000000..f8734e77 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/logo/utils/tests/SoundsDemo.java @@ -0,0 +1,13 @@ +package org.teachingextensions.logo.utils.tests; + +import junit.framework.TestCase; + +import org.teachingextensions.logo.utils.Sounds; + +public class SoundsDemo extends TestCase +{ + public void testBeep() throws Exception + { + Sounds.playBeep(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.class b/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.class new file mode 100644 index 00000000..c85fbeaa Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.java b/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.java new file mode 100644 index 00000000..fd237abc --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/CommandLineUtils.java @@ -0,0 +1,21 @@ +package org.teachingextensions.setup; + +import java.io.IOException; + +import com.spun.util.ObjectUtils; + +public class CommandLineUtils +{ + public static void launch(String commandLine, String... formattingArguments) + { + try + { + String command = String.format(commandLine, (Object[]) formattingArguments); + Process exec = Runtime.getRuntime().exec(command); + } + catch (IOException e) + { + ObjectUtils.throwAsError(e); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.class b/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.class new file mode 100644 index 00000000..55d92f8b Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.java b/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.java new file mode 100644 index 00000000..74ff5979 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/MacThumbDriveInstaller.java @@ -0,0 +1,51 @@ +package org.teachingextensions.setup; + +import java.io.File; +import java.io.IOException; + +import javax.swing.filechooser.FileSystemView; + +import com.spun.util.ObjectUtils; +import com.spun.util.io.ZipUtils; + +public class MacThumbDriveInstaller +{ + public void install() throws Exception + { + installEclipse(); + installWorkspace(); + launch(); + } + private void launch() + { + String command = "java -jar TKP_Launcher.jar"; + try + { + Process exec = Runtime.getRuntime().exec(command, null, + new File(getDesktop().getAbsolutePath() + "/TeachingKidsProgramming.Java-master")); + } + catch (IOException e) + { + ObjectUtils.throwAsError(e); + } + } + private void installWorkspace() throws IOException + { + File zipFile = new File("./TeachingKidsProgramming.Java-master.zip"); + File unzipTo = getDesktop(); + System.out.println("Unzip to " + unzipTo); + ZipUtils.doUnzip(unzipTo, zipFile); + } + public File getDesktop() + { + File homeDirectory = FileSystemView.getFileSystemView().getHomeDirectory(); + File unzipTo = new File(homeDirectory.getAbsolutePath() + "/Desktop"); + return unzipTo; + } + private void installEclipse() throws Exception + { + File installDir = new File("/Applications/Eclipse"); + if (installDir.exists()) { return; } + ZipUtils.doUnzip(new File("/Applications"), new File("./eclipse-mac.zip")); + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/SetupConfig.class b/build/src/main/resources/org/teachingextensions/setup/SetupConfig.class new file mode 100644 index 00000000..39400f04 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/SetupConfig.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/SetupConfig.java b/build/src/main/resources/org/teachingextensions/setup/SetupConfig.java new file mode 100644 index 00000000..513d1cec --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/SetupConfig.java @@ -0,0 +1,21 @@ +package org.teachingextensions.setup; + +import org.teachingextensions.setup.SetupValidator.SetupCheckPoints; + +import com.spun.util.SystemUtils; +import com.spun.util.servlets.ValidationError; + +public class SetupConfig +{ + public ValidationError setup = new ValidationError(SetupCheckPoints.values()); + public String workspacePath = "."; //"C:\\Users\\Llewellyn\\workspace\\ApprovalTestsKoans\\TeachingKidsProgramming.Java"; + public String eclipsePath = SystemUtils.isWindowsEnviroment() + ? eclipsePathWindows + : eclipsePathMac; + public static String eclipsePathWindows = "c:\\eclipse\\eclipse.exe"; + public static String eclipsePathMac = "/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse"; + public void assertSetupIsCorrect() + { + if (!setup.isOk()) { throw setup; } + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/SetupValidator$SetupCheckPoints.class b/build/src/main/resources/org/teachingextensions/setup/SetupValidator$SetupCheckPoints.class new file mode 100644 index 00000000..c524cec3 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/SetupValidator$SetupCheckPoints.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/SetupValidator.class b/build/src/main/resources/org/teachingextensions/setup/SetupValidator.class new file mode 100644 index 00000000..10b61cf3 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/SetupValidator.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/SetupValidator.java b/build/src/main/resources/org/teachingextensions/setup/SetupValidator.java new file mode 100644 index 00000000..21cf1c50 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/SetupValidator.java @@ -0,0 +1,96 @@ +package org.teachingextensions.setup; + +import java.io.File; +import java.io.IOException; + +import org.teachingextensions.windows.MessageBox; + +import com.spun.util.ObjectUtils; +import com.spun.util.io.FileUtils; +import com.spun.util.io.ZipUtils; + +public class SetupValidator +{ + public enum SetupCheckPoints { + MetadataUnzipped, EclipseIsInstalled, WorkspaceFound + } + public static void main(String[] args) + { + try + { + SetupConfig config = new SetupConfig(); + validateEclipse(config); + validateWorkspace(config); + launchEclipse(config); + config.assertSetupIsCorrect(); + } + catch (Throwable t) + { + MessageBox.showMessage("Something went wrong: \r\n" + t.getMessage()); + } + } + private static void launchEclipse(SetupConfig config) + { + if (!config.setup.isOk()) { return; } + CommandLineUtils.launch("%s -data %s", config.eclipsePath, config.workspacePath); + } + private static void validateWorkspace(SetupConfig config) + { + isCodeUnpacked(config); + isWorkSpaceConfigured(config); + } + private static void isWorkSpaceConfigured(SetupConfig config) + { + String metadataPath = config.workspacePath + File.separator + ".metadata"; + unpackWorkspaceIfNeeded(config, metadataPath); + boolean metadata = new File(metadataPath).exists(); + if (metadata) + { + String configPath = metadataPath + File.separator + + ".plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs"; + String configText = FileUtils.readFileWithSuppressedExceptions(new File(configPath)); + metadata = configText.contains("lineNumberRuler=true"); + config.setup.set(SetupCheckPoints.MetadataUnzipped, metadata, + "The metadata was not unzipped correctly, you need to delete: " + metadataPath); + } + } + private static void unpackWorkspaceIfNeeded(SetupConfig config, String metadataPath) + { + try + { + boolean metadata = new File(metadataPath).exists(); + if (!metadata) + { + ZipUtils.doUnzip(new File(config.workspacePath), new File(config.workspacePath + File.separator + + "eclipse_workspace.zip")); + } + } + catch (IOException e) + { + ObjectUtils.throwAsError(e); + } + } + private static void isCodeUnpacked(SetupConfig config) + { + try + { + config.workspacePath = new File(".").getCanonicalPath(); + String realtivePath = "TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquare.java" + .replace('/', File.separatorChar); + File simpleSquare = new File(config.workspacePath + File.separator + realtivePath); + config.setup.set(SetupCheckPoints.WorkspaceFound, simpleSquare.exists(), + "could not find the TKP workspace at " + config.workspacePath + "\r\n The Following File should exist:" + + simpleSquare.getAbsolutePath()); + } + catch (IOException e) + { + ObjectUtils.throwAsError(e); + } + } + private static void validateEclipse(SetupConfig config) + { + boolean exists = new File(config.eclipsePath).exists(); + String base = config.eclipsePath.substring(0, config.eclipsePath.indexOf(File.separator, 3)); + config.setup.set(SetupCheckPoints.EclipseIsInstalled, exists, "could not find Eclipse at " + base); + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.class b/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.class new file mode 100644 index 00000000..217f002b Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.java b/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.java new file mode 100644 index 00000000..f2d9422c --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/ThumbDriveInstaller.java @@ -0,0 +1,22 @@ +package org.teachingextensions.setup; + +import com.spun.util.SystemUtils; + +public class ThumbDriveInstaller +{ + public static void main(String[] args) throws Exception + { + installForThumbDrive(); + } + private static void installForThumbDrive() throws Exception + { + if (SystemUtils.isWindowsEnviroment()) + { + new WindowsThumbDriveInstaller().install(); + } + else + { + new MacThumbDriveInstaller().install(); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.class b/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.class new file mode 100644 index 00000000..c97830e1 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.class differ diff --git a/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.java b/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.java new file mode 100644 index 00000000..817a7ea2 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/WindowsThumbDriveInstaller.java @@ -0,0 +1,8 @@ +package org.teachingextensions.setup; + +public class WindowsThumbDriveInstaller +{ + public void install() + { + } +} diff --git a/build/src/main/resources/org/teachingextensions/setup/tests/UnzipTest.java b/build/src/main/resources/org/teachingextensions/setup/tests/UnzipTest.java new file mode 100644 index 00000000..22fffc46 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/setup/tests/UnzipTest.java @@ -0,0 +1,15 @@ +package org.teachingextensions.setup.tests; + +import java.io.File; + +import com.spun.util.io.ZipUtils; + +public class UnzipTest // extends TestCase +{ + public void ptestUnzip() throws Exception + { + String zip = "C:/Users/Llewellyn/Downloads/TeachingKidsProgramming.Java-master/TeachingKidsProgramming.Java-master/eclipse_workspace.zip"; + String dir = "C:/Users/Llewellyn/Downloads/TeachingKidsProgramming.Java-master/TeachingKidsProgramming.Java-master/"; + ZipUtils.doUnzip(new File(dir), new File(zip)); + } +} diff --git a/build/src/main/resources/org/teachingextensions/simpleparser/Parser$1.class b/build/src/main/resources/org/teachingextensions/simpleparser/Parser$1.class new file mode 100644 index 00000000..bba1f3d4 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/simpleparser/Parser$1.class differ diff --git a/build/src/main/resources/org/teachingextensions/simpleparser/Parser.class b/build/src/main/resources/org/teachingextensions/simpleparser/Parser.class new file mode 100644 index 00000000..4522a727 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/simpleparser/Parser.class differ diff --git a/build/src/main/resources/org/teachingextensions/simpleparser/Parser.java b/build/src/main/resources/org/teachingextensions/simpleparser/Parser.java new file mode 100644 index 00000000..2090f0aa --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/simpleparser/Parser.java @@ -0,0 +1,68 @@ +package org.teachingextensions.simpleparser; + +import java.lang.reflect.Field; +import java.util.List; + +import org.lambda.functions.Function1; +import org.lambda.query.Query; + +import com.spun.util.ObjectUtils; +import com.spun.util.io.FileUtils; + +public class Parser +{ + public static String parse(String text, Object data) + { + return parse(text, "{", "}", data); + } + public static String parse(String text, String startCharacter, String endCharacter, Object data) + { + StringBuffer sb = new StringBuffer(); + String temp = text; + int start = temp.indexOf(startCharacter); + while (start > 0) + { + int end = temp.indexOf(endCharacter, start); + sb.append(temp.substring(0, start)); + String key = temp.substring(start + startCharacter.length(), end); + sb.append(getValue(key, data)); + temp = temp.substring(end + endCharacter.length()); + start = temp.indexOf(startCharacter); + } + sb.append(temp); + return sb.toString(); + } + private static String getValue(final String piece, Object data) + { + try + { + Field[] declaredFields = data.getClass().getDeclaredFields(); + List f = Query.where(declaredFields, new Function1() + { + @Override + public Boolean call(Field i) + { + return i.getName().equals(piece); + } + }); + f.get(0).setAccessible(true); + return "" + f.get(0).get(data); + } + catch (Exception e) + { + return piece; + } + } + public static String parseRtfFile(String fileName, Object data) + { + try + { + String text = FileUtils.readFromClassPath(data.getClass(), fileName); + return parse(text, "\\{", "\\}", data); + } + catch (Exception e) + { + throw ObjectUtils.throwAsError(e); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.java b/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.java new file mode 100644 index 00000000..6d611dfa --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.java @@ -0,0 +1,20 @@ +package org.teachingextensions.simpleparser.tests; + +import junit.framework.TestCase; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.teachingextensions.simpleparser.Parser; + +@UseReporter(DiffReporter.class) +public class ParserTest extends TestCase +{ + private int a = 1; + private String b = "howdy"; + public void testSimpleParse() throws Exception + { + String text = Parser.parse("This should show \r\n a = {a} \r\n b = {b}", this); + Approvals.verify(text); + } +} diff --git a/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.testSimpleParse.approved.txt b/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.testSimpleParse.approved.txt new file mode 100644 index 00000000..9815e21c --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/simpleparser/tests/ParserTest.testSimpleParse.approved.txt @@ -0,0 +1,3 @@ +This should show + a = 1 + b = howdy \ No newline at end of file diff --git a/build/src/main/resources/org/teachingextensions/utils/Viewer.class b/build/src/main/resources/org/teachingextensions/utils/Viewer.class new file mode 100644 index 00000000..d64ed40b Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/utils/Viewer.class differ diff --git a/build/src/main/resources/org/teachingextensions/utils/Viewer.java b/build/src/main/resources/org/teachingextensions/utils/Viewer.java new file mode 100644 index 00000000..993ef0ee --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/utils/Viewer.java @@ -0,0 +1,28 @@ +package org.teachingextensions.utils; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import com.spun.util.ObjectUtils; +import com.spun.util.tests.TestUtils; + +public class Viewer +{ + public static void displayRtfFile(String text) + { + try + { + File file; + file = File.createTempFile("currentStory", ".rtf"); + FileWriter f = new FileWriter(file); + f.write(text); + f.close(); + TestUtils.displayFile(file.getPath()); + } + catch (IOException e) + { + throw ObjectUtils.throwAsError(e); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/utils/VirtualProctor$internals.class b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor$internals.class new file mode 100644 index 00000000..e78dbb71 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor$internals.class differ diff --git a/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.class b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.class new file mode 100644 index 00000000..55711d83 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.class differ diff --git a/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.java b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.java new file mode 100644 index 00000000..7ab09fa2 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/utils/VirtualProctor.java @@ -0,0 +1,58 @@ +package org.teachingextensions.utils; + +import java.io.File; + +import com.spun.util.StringUtils; +import com.spun.util.io.FileUtils; + +public class VirtualProctor +{ + public static class internals + { + private static final String FILE_NAME = ".virtual_proctor.txt"; + public static String getName() + { + String name = getCustomName(); + if (name == null) + { + name = getComputerName(); + } + if (name == null) + { + name = getUserName(); + } + return name; + } + private static String getCustomName() + { + File file = new File(FILE_NAME); + if (file.exists()) { return FileUtils.readFileWithSuppressedExceptions(file).trim(); } + return null; + } + public static String getComputerName() + { + return System.getenv("COMPUTERNAME"); + } + public static String getUserName() + { + return System.getenv("USER"); + } + public static void resetName() + { + File file = new File(FILE_NAME); + if (file.exists()) + { + file.delete(); + } + } + public static void setName(String name) + { + if (StringUtils.isEmpty(name)) { return; } + FileUtils.writeFileQuietly(new File(FILE_NAME), name); + } + } + public static void setName(String name) + { + internals.setName(name); + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.class b/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.class new file mode 100644 index 00000000..3d92c214 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.java b/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.java new file mode 100644 index 00000000..f9adc4e7 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/GraphicsWindow.java @@ -0,0 +1,10 @@ +package org.teachingextensions.windows; + +public class GraphicsWindow +{ + public static void show() + { + // DisplayWindow displayWindow = new DisplayWindow(); + // DisplayWindow.show(); + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.class b/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.class new file mode 100644 index 00000000..785c378a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.java b/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.java new file mode 100644 index 00000000..2e819a37 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/LeftClickMouseAdapter.java @@ -0,0 +1,39 @@ +package org.teachingextensions.windows; + +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import javax.swing.SwingUtilities; + +public class LeftClickMouseAdapter implements MouseListener +{ + private final MouseLeftClickListener listener; + public LeftClickMouseAdapter(MouseLeftClickListener listener) + { + this.listener = listener; + } + @Override + public void mouseClicked(MouseEvent e) + { + } + @Override + public void mouseEntered(MouseEvent e) + { + } + @Override + public void mouseExited(MouseEvent e) + { + } + @Override + public void mousePressed(MouseEvent e) + { + } + @Override + public void mouseReleased(MouseEvent e) + { + if (SwingUtilities.isLeftMouseButton(e)) + { + listener.onLeftMouseClick(e.getX(), e.getY()); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/MessageBox$MessageBoxInstance.class b/build/src/main/resources/org/teachingextensions/windows/MessageBox$MessageBoxInstance.class new file mode 100644 index 00000000..e95bc73e Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/MessageBox$MessageBoxInstance.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/MessageBox.class b/build/src/main/resources/org/teachingextensions/windows/MessageBox.class new file mode 100644 index 00000000..671cfdcd Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/MessageBox.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/MessageBox.java b/build/src/main/resources/org/teachingextensions/windows/MessageBox.java new file mode 100644 index 00000000..849e8116 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/MessageBox.java @@ -0,0 +1,73 @@ +package org.teachingextensions.windows; + +import javax.swing.JOptionPane; + +import com.spun.util.NumberUtils; + +/** + * + * MessageBox is a window that can collect a numerical input from the user + * or prints a message for the user to read.
+ * + * + * + */ +public class MessageBox +{ + private static MessageBoxInstance messageBox = new MessageBoxInstance(); + /** + * Prints a request for a numerical input to the window.
+ * Example: {@code int cookies = MessageBox.askForNumericalInput("How many cookies would you like?");} + * + * @param message + * the text to be displayed + * @return the user input + */ + public static int askForNumericalInput(String message) + { + return messageBox.askForNumericalInput(message); + } + /** + * Prints a request for a text input to the window.
+ * Example: {@code String name = MessageBox.askForTextInput("What is your nickname?");} + * + * @param message + * the text to be displayed + * @return the user input + */ + public static String askForTextInput(String message) + { + return messageBox.askForTextInput(message); + } + /** + * Prints the message to the window.
+ * Example: {@code MessageBox.showMessage("Girl programmers rule!");} + * + * @param message + * the text to be displayed + */ + public static void showMessage(String message) + { + messageBox.showMessage(message); + } + public static void mock(MessageBoxInstance messageBoxMock) + { + messageBox = messageBoxMock; + } + public static class MessageBoxInstance + { + public int askForNumericalInput(String message) + { + String input = askForTextInput(message); + return NumberUtils.load(input, 0); + } + public String askForTextInput(String message) + { + return JOptionPane.showInputDialog(message); + } + public void showMessage(String message) + { + JOptionPane.showMessageDialog(null, message); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.class b/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.class new file mode 100644 index 00000000..f87ad351 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.java b/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.java new file mode 100644 index 00000000..82e3d4f6 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/MouseLeftClickListener.java @@ -0,0 +1,6 @@ +package org.teachingextensions.windows; + +public interface MouseLeftClickListener +{ + void onLeftMouseClick(int x, int y); +} diff --git a/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.class b/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.class new file mode 100644 index 00000000..e174f25c Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.java b/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.java new file mode 100644 index 00000000..d3568cea --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/MouseRightClickListener.java @@ -0,0 +1,6 @@ +package org.teachingextensions.windows; + +public interface MouseRightClickListener +{ + void onRightMouseClick(int x, int y); +} diff --git a/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.class b/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.class new file mode 100644 index 00000000..f0a5bd7a Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.java b/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.java new file mode 100644 index 00000000..191ca073 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/ProgramWindow.java @@ -0,0 +1,74 @@ +package org.teachingextensions.windows; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.util.ArrayList; + +import javax.swing.JFrame; +import javax.swing.JPanel; + +import org.teachingextensions.logo.Colors; +import org.teachingextensions.logo.ImageBackground; +import org.teachingextensions.logo.Paintable; +import org.teachingextensions.logo.VirtualProctorWeb; + +import com.spun.util.FrameCloser; +import com.spun.util.WindowUtils; + +public class ProgramWindow extends JPanel +{ + private ArrayList additional = new ArrayList(); + public ProgramWindow(String title) + { + this(); + JFrame frame = new JFrame(title); + frame.getContentPane().add(this); + ProgramWindow.createStandardFrame(frame); + } + public ProgramWindow() + { + setPreferredSize(new Dimension(627, 442)); + setColor(Colors.Whites.White); + } + public static void createStandardFrame(JFrame frame) + { + WindowUtils.testFrame(frame, new VirtualProctorWeb(), new FrameCloser()); + } + @Override + public void paint(Graphics g) + { + super.paint(g); + for (Paintable p : additional) + { + p.paint((Graphics2D) g, this); + } + } + public void setColor(Color backgroundColor) + { + setBackground(backgroundColor); + } + public void addPaintable(Paintable additional) + { + this.additional.add(additional); + repaint(); + } + public void removePaintable() + { + additional.clear(); + repaint(); + } + public void addMouseRightClickListener(MouseRightClickListener listener) + { + addMouseListener(new RightClickMouseAdapter(listener)); + } + public void addMouseLeftClickListener(MouseLeftClickListener listener) + { + addMouseListener(new LeftClickMouseAdapter(listener)); + } + public void setBackgroundImage(String url) + { + addPaintable(new ImageBackground(url)); + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.class b/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.class new file mode 100644 index 00000000..896eb7d2 Binary files /dev/null and b/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.class differ diff --git a/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.java b/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.java new file mode 100644 index 00000000..77960d2b --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/RightClickMouseAdapter.java @@ -0,0 +1,39 @@ +package org.teachingextensions.windows; + +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import javax.swing.SwingUtilities; + +public class RightClickMouseAdapter implements MouseListener +{ + private final MouseRightClickListener listener; + public RightClickMouseAdapter(MouseRightClickListener listener) + { + this.listener = listener; + } + @Override + public void mouseClicked(MouseEvent e) + { + } + @Override + public void mouseEntered(MouseEvent e) + { + } + @Override + public void mouseExited(MouseEvent e) + { + } + @Override + public void mousePressed(MouseEvent e) + { + } + @Override + public void mouseReleased(MouseEvent e) + { + if (SwingUtilities.isRightMouseButton(e)) + { + listener.onRightMouseClick(e.getX(), e.getY()); + } + } +} diff --git a/build/src/main/resources/org/teachingextensions/windows/tests/GraphicsWindowTest.java b/build/src/main/resources/org/teachingextensions/windows/tests/GraphicsWindowTest.java new file mode 100644 index 00000000..7da39220 --- /dev/null +++ b/build/src/main/resources/org/teachingextensions/windows/tests/GraphicsWindowTest.java @@ -0,0 +1,15 @@ +package org.teachingextensions.windows.tests; + +import junit.framework.TestCase; + +import org.approvaltests.reporters.DelayedClipboardReporter; +import org.approvaltests.reporters.FileLauncherReporter; +import org.approvaltests.reporters.UseReporter; + +@UseReporter({FileLauncherReporter.class, DelayedClipboardReporter.class}) +public class GraphicsWindowTest extends TestCase +{ + public void testEmptyWindow() throws Exception + { + } +} diff --git a/build/src/main/resources/you/need/to/fill/in/the/______.class b/build/src/main/resources/you/need/to/fill/in/the/______.class new file mode 100644 index 00000000..bea57b3a Binary files /dev/null and b/build/src/main/resources/you/need/to/fill/in/the/______.class differ diff --git a/eclipse_workspace.zip b/eclipse_workspace.zip deleted file mode 100644 index 759f3964..00000000 Binary files a/eclipse_workspace.zip and /dev/null differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..b815728e --- /dev/null +++ b/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + org.teachingkids.programming + teaching-kids-programming + 1.0-SNAPSHOT + pom + Teaching Kids Programming + + build + recipes + sections + + + + junit + junit + 4.11 + + + diff --git a/recipes/pom.xml b/recipes/pom.xml new file mode 100644 index 00000000..473ae8c3 --- /dev/null +++ b/recipes/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + teaching-kids-programming + org.teachingkids.programming + 1.0-SNAPSHOT + + recipes + TKP :: Recipe + + + org.teachingkids.programming + simple-square-lib + ${project.version} + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/WaterMark.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/WaterMark.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/WaterMark.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/WaterMark.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/deepdives/DeepDive09Exceptions.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/deepdives/DeepDive09Exceptions.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/deepdives/DeepDive09Exceptions.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/deepdives/DeepDive09Exceptions.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/SimpleBubbleQuiz.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/SimpleBubbleQuiz.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/SimpleBubbleQuiz.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/SimpleBubbleQuiz.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/SpiderWebQuiz.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/SpiderWebQuiz.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/SpiderWebQuiz.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/SpiderWebQuiz.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuiz.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuiz.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuiz.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuiz.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HiLowQuizGrader.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizAdapter.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizAdapter.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizAdapter.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizAdapter.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/HousesQuizGrader.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/MessageBoxMock.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/MessageBoxMock.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/MessageBoxMock.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/MessageBoxMock.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonCrazyQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonCrazyQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonCrazyQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonCrazyQuizGrader.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonQuizAdapter.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonQuizAdapter.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonQuizAdapter.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonQuizAdapter.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/QuizUtils.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/QuizUtils.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/QuizUtils.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/QuizUtils.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SimpleSquareQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SimpleSquareQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SimpleSquareQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SimpleSquareQuizGrader.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderQuiz.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderQuiz.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderQuiz.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderQuiz.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderWebQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderWebQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderWebQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SpiderWebQuizGrader.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SquareQuiz.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SquareQuiz.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/SquareQuiz.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/SquareQuiz.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizAdapter.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizAdapter.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizAdapter.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizAdapter.java diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizGrader.java b/recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizGrader.java similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizGrader.java rename to recipes/src/main/java/org/teachingkidsprogramming/recipes/quizzes/graders/TreeQuizGrader.java diff --git a/sections/pom.xml b/sections/pom.xml new file mode 100644 index 00000000..ad859398 --- /dev/null +++ b/sections/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + teaching-kids-programming + org.teachingkids.programming + 1.0-SNAPSHOT + + sections + TKP :: Sections + pom + + section01 + section02 + section03 + section04 + section05 + section06 + section07 + + + + org.teachingkids.programming + recipes + ${project.version} + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/PrintThis/1_SimpleSquareWorksheet.docx b/sections/section01/_PrintThis/1_SimpleSquareWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/PrintThis/1_SimpleSquareWorksheet.docx rename to sections/section01/_PrintThis/1_SimpleSquareWorksheet.docx diff --git a/sections/section01/pom.xml b/sections/section01/pom.xml new file mode 100644 index 00000000..80d7d4b4 --- /dev/null +++ b/sections/section01/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section01 + TKP :: Sections :: 01 + section01 + pom + + simple-square + simple-square-quiz + spiral + square + tests + + diff --git a/sections/section01/simple-square-quiz/pom.xml b/sections/section01/simple-square-quiz/pom.xml new file mode 100644 index 00000000..f20359cd --- /dev/null +++ b/sections/section01/simple-square-quiz/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section01 + org.teachingkids.programming.section01 + 1.0-SNAPSHOT + + simple-square-quiz + TKP :: Sections :: 01 :: SimpleSquare Quiz + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section01.quiz.SimpleSquareQuiz + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquareQuiz.java b/sections/section01/simple-square-quiz/src/main/java/org/teachingkidsprogramming/section01/quiz/SimpleSquareQuiz.java similarity index 92% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquareQuiz.java rename to sections/section01/simple-square-quiz/src/main/java/org/teachingkidsprogramming/section01/quiz/SimpleSquareQuiz.java index 080eceba..4cd29b4a 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquareQuiz.java +++ b/sections/section01/simple-square-quiz/src/main/java/org/teachingkidsprogramming/section01/quiz/SimpleSquareQuiz.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section01forloops; +package org.teachingkidsprogramming.section01.quiz; import org.teachingkidsprogramming.recipes.quizzes.graders.SimpleSquareQuizGrader; import org.teachingkidsprogramming.recipes.quizzes.graders.SquareQuiz; diff --git a/sections/section01/simple-square/pom.xml b/sections/section01/simple-square/pom.xml new file mode 100644 index 00000000..eab597cb --- /dev/null +++ b/sections/section01/simple-square/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + section01 + org.teachingkids.programming.section01 + 1.0-SNAPSHOT + + simple-square + TKP :: Sections :: 01 :: SimpleSquare + + + org.teachingkids.programming + simple-square-lib + ${project.version} + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section01.simplesquare.SimpleSquare + true + lib/ + + + + + + + diff --git a/sections/section01/simple-square/src/main/java/org/teachingkidsprogramming/section01/simplesquare/SimpleSquare.java b/sections/section01/simple-square/src/main/java/org/teachingkidsprogramming/section01/simplesquare/SimpleSquare.java new file mode 100644 index 00000000..b8d04a94 --- /dev/null +++ b/sections/section01/simple-square/src/main/java/org/teachingkidsprogramming/section01/simplesquare/SimpleSquare.java @@ -0,0 +1,18 @@ +package org.teachingkidsprogramming.section01.simplesquare; + +public class SimpleSquare +{ + public static void main(String[] args) throws Exception + { + // Show the tortoise --#1 + // Make the tortoise move as fast as possible --#6 + // Do the following 4 times --#5.1 + // Change the color of the line the tortoise draws to "blue" --#4 + // Move the tortoise 50 pixels --#2 + // Turn the tortoise to the right (90 degrees) --#3 + // Repeat --#5.2 + } + /* + * After you finish, watch the video recap at http://youtu.be/5bqUZEsJh_Q + */ +} diff --git a/sections/section01/spiral/pom.xml b/sections/section01/spiral/pom.xml new file mode 100644 index 00000000..aec66fa7 --- /dev/null +++ b/sections/section01/spiral/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section01 + org.teachingkids.programming.section01 + 1.0-SNAPSHOT + + spiral + TKP :: Sections :: 01 :: Spiral + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section01.spiral.Spiral + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/Spiral.java b/sections/section01/spiral/src/main/java/org/teachingkidsprogramming/section01/spiral/Spiral.java similarity index 91% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/Spiral.java rename to sections/section01/spiral/src/main/java/org/teachingkidsprogramming/section01/spiral/Spiral.java index 9fcd4f20..253e4559 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/Spiral.java +++ b/sections/section01/spiral/src/main/java/org/teachingkidsprogramming/section01/spiral/Spiral.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section01forloops; +package org.teachingkidsprogramming.section01.spiral; public class Spiral { diff --git a/sections/section01/square/pom.xml b/sections/section01/square/pom.xml new file mode 100644 index 00000000..e977d9de --- /dev/null +++ b/sections/section01/square/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + section01 + org.teachingkids.programming.section01 + 1.0-SNAPSHOT + + simple-square-example + TKP :: Sections :: 01 :: SimpleSquare + + + org.teachingkids.programming + simple-square-lib + ${project.version} + + + + src + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + SimpleSquare + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquare.java b/sections/section01/square/src/SimpleSquare.java similarity index 90% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquare.java rename to sections/section01/square/src/SimpleSquare.java index 36cbf1a2..441d89c1 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/SimpleSquare.java +++ b/sections/section01/square/src/SimpleSquare.java @@ -1,4 +1,3 @@ -package org.teachingkidsprogramming.section01forloops; public class SimpleSquare { diff --git a/sections/section01/tests/pom.xml b/sections/section01/tests/pom.xml new file mode 100644 index 00000000..b081cff2 --- /dev/null +++ b/sections/section01/tests/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + + section01 + org.teachingkids.programming.section01 + 1.0-SNAPSHOT + + tests + TKP :: Sections :: 01 :: Tests + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/DeepDive01ForLoops.java b/sections/section01/tests/src/test/java/org/teachingkidsprogramming/section01/tests/DeepDive01ForLoopsTest.java similarity index 97% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/DeepDive01ForLoops.java rename to sections/section01/tests/src/test/java/org/teachingkidsprogramming/section01/tests/DeepDive01ForLoopsTest.java index b0518eef..09d28614 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section01forloops/DeepDive01ForLoops.java +++ b/sections/section01/tests/src/test/java/org/teachingkidsprogramming/section01/tests/DeepDive01ForLoopsTest.java @@ -1,15 +1,14 @@ -package org.teachingkidsprogramming.section01forloops; +package org.teachingkidsprogramming.section01.tests; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.teachingextensions.logo.Tortoise; import org.teachingextensions.logo.Turtle; import org.teachingextensions.logo.utils.TortoiseUtils; -public class DeepDive01ForLoops +public class DeepDive01ForLoopsTest { // How to do deep dive: // Step 1: Select the method name (numbersDoNotNeedQuotes on line 24) Press the Run Button diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/PrintThis/2_HousesWorksheet.docx b/sections/section02/_PrintThis/2_HousesWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/PrintThis/2_HousesWorksheet.docx rename to sections/section02/_PrintThis/2_HousesWorksheet.docx diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/PrintThis/Tortoise.pdf b/sections/section02/_PrintThis/Tortoise.pdf similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/PrintThis/Tortoise.pdf rename to sections/section02/_PrintThis/Tortoise.pdf diff --git a/sections/section02/foursquare/pom.xml b/sections/section02/foursquare/pom.xml new file mode 100644 index 00000000..161fa784 --- /dev/null +++ b/sections/section02/foursquare/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + section02 + org.teachingkids.programming.section02 + 1.0-SNAPSHOT + + foursquare + TKP :: Sections :: 02 :: FourSquare + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section02.foursquare.FourSquare + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/FourSquare.java b/sections/section02/foursquare/src/main/java/org/teachingkidsprogramming/section02/foursquare/FourSquare.java similarity index 93% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/FourSquare.java rename to sections/section02/foursquare/src/main/java/org/teachingkidsprogramming/section02/foursquare/FourSquare.java index a42bdb22..7e3dffc8 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/FourSquare.java +++ b/sections/section02/foursquare/src/main/java/org/teachingkidsprogramming/section02/foursquare/FourSquare.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section02methods; +package org.teachingkidsprogramming.section02.foursquare; public class FourSquare { diff --git a/sections/section02/house-quiz/pom.xml b/sections/section02/house-quiz/pom.xml new file mode 100644 index 00000000..d776ba1e --- /dev/null +++ b/sections/section02/house-quiz/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + section02 + org.teachingkids.programming.section02 + 1.0-SNAPSHOT + + house-quiz + TKP :: Sections :: 02 :: HouseQuiz + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section02.quiz.HousesQuiz + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/HousesQuiz.java b/sections/section02/house-quiz/src/main/java/org/teachingkidsprogramming/section02/quiz/HousesQuiz.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/HousesQuiz.java rename to sections/section02/house-quiz/src/main/java/org/teachingkidsprogramming/section02/quiz/HousesQuiz.java index c7706152..bd85ce1b 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/HousesQuiz.java +++ b/sections/section02/house-quiz/src/main/java/org/teachingkidsprogramming/section02/quiz/HousesQuiz.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section02methods; +package org.teachingkidsprogramming.section02.quiz; import org.teachingkidsprogramming.recipes.quizzes.graders.HousesQuizAdapter; import org.teachingkidsprogramming.recipes.quizzes.graders.HousesQuizGrader; diff --git a/sections/section02/house/pom.xml b/sections/section02/house/pom.xml new file mode 100644 index 00000000..b6b9633e --- /dev/null +++ b/sections/section02/house/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + section02 + org.teachingkids.programming.section02 + 1.0-SNAPSHOT + + house + TKP :: Sections :: 02 :: House + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section02.house.Houses + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/Houses.java b/sections/section02/house/src/main/java/org/teachingkidsprogramming/section02/house/Houses.java similarity index 95% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/Houses.java rename to sections/section02/house/src/main/java/org/teachingkidsprogramming/section02/house/Houses.java index b108d696..09f6d741 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/Houses.java +++ b/sections/section02/house/src/main/java/org/teachingkidsprogramming/section02/house/Houses.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section02methods; +package org.teachingkidsprogramming.section02.house; public class Houses { diff --git a/sections/section02/pom.xml b/sections/section02/pom.xml new file mode 100644 index 00000000..d92c0c9d --- /dev/null +++ b/sections/section02/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section02 + TKP :: Sections :: 02 + + section02 + pom + + foursquare + house + house-quiz + triangle-shell + tests + + \ No newline at end of file diff --git a/sections/section02/tests/pom.xml b/sections/section02/tests/pom.xml new file mode 100644 index 00000000..98447edf --- /dev/null +++ b/sections/section02/tests/pom.xml @@ -0,0 +1,11 @@ + + + 4.0.0 + + section02 + org.teachingkids.programming.section02 + 1.0-SNAPSHOT + + TKP :: Sections :: 02 :: Tests + tests + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/DeepDive02Variables.java b/sections/section02/tests/src/test/java/org/teachingkidsprogramming/section02/tests/DeepDive02VariablesTest.java similarity index 95% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/DeepDive02Variables.java rename to sections/section02/tests/src/test/java/org/teachingkidsprogramming/section02/tests/DeepDive02VariablesTest.java index 3731abde..6bd86372 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/DeepDive02Variables.java +++ b/sections/section02/tests/src/test/java/org/teachingkidsprogramming/section02/tests/DeepDive02VariablesTest.java @@ -1,11 +1,10 @@ -package org.teachingkidsprogramming.section02methods; +package org.teachingkidsprogramming.section02.tests; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; -public class DeepDive02Variables +public class DeepDive02VariablesTest { // How to do deep dive: // Step 1: Select the method name (youCanReadVariables on line 20) Press the Run Button @@ -33,7 +32,7 @@ public void youCanSaveVariables() throws Exception public void youCanDoMathWithVariables() throws Exception { int ____ = 3 + 4; - Assert.assertEquals(7, numberOfHarryPotterBooks); + Assert.assertEquals(7, ____); } @Test public void youCanChangeVariables() throws Exception diff --git a/sections/section02/triangle-shell/pom.xml b/sections/section02/triangle-shell/pom.xml new file mode 100644 index 00000000..d07cff01 --- /dev/null +++ b/sections/section02/triangle-shell/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + section02 + org.teachingkids.programming.section02 + 1.0-SNAPSHOT + + triangle-shell + TKP :: Sections :: 02 :: TriangleShell + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section02.triangle.TriangleShell + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/TriangleShell.java b/sections/section02/triangle-shell/src/main/java/org/teachingkidsprogramming/section02/triangle/TriangleShell.java similarity index 94% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/TriangleShell.java rename to sections/section02/triangle-shell/src/main/java/org/teachingkidsprogramming/section02/triangle/TriangleShell.java index 8e636659..f3ade4ff 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section02methods/TriangleShell.java +++ b/sections/section02/triangle-shell/src/main/java/org/teachingkidsprogramming/section02/triangle/TriangleShell.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section02methods; +package org.teachingkidsprogramming.section02.triangle; public class TriangleShell { diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/PrintThis/3_HiLowWorksheet.docx b/sections/section03/_PrintThis/3_HiLowWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/PrintThis/3_HiLowWorksheet.docx rename to sections/section03/_PrintThis/3_HiLowWorksheet.docx diff --git a/sections/section03/adventure/pom.xml b/sections/section03/adventure/pom.xml new file mode 100644 index 00000000..48259527 --- /dev/null +++ b/sections/section03/adventure/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section03 + org.teachingkids.programming.section03 + 1.0-SNAPSHOT + + adventure + TKP :: Sections :: 03 :: Adventure + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section03.adventure.ChooseYourOwnAdventure + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/ChooseYourOwnAdventure.java b/sections/section03/adventure/src/main/java/org/teachingkidsprogramming/section03/adventure/ChooseYourOwnAdventure.java similarity index 98% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/ChooseYourOwnAdventure.java rename to sections/section03/adventure/src/main/java/org/teachingkidsprogramming/section03/adventure/ChooseYourOwnAdventure.java index 8c17995a..eb745b0d 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/ChooseYourOwnAdventure.java +++ b/sections/section03/adventure/src/main/java/org/teachingkidsprogramming/section03/adventure/ChooseYourOwnAdventure.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section03ifs; +package org.teachingkidsprogramming.section03.adventure; public class ChooseYourOwnAdventure { diff --git a/sections/section03/hilow-quiz/pom.xml b/sections/section03/hilow-quiz/pom.xml new file mode 100644 index 00000000..f9601da3 --- /dev/null +++ b/sections/section03/hilow-quiz/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section03 + org.teachingkids.programming.section03 + 1.0-SNAPSHOT + + hilowquiz + TKP :: Sections :: 03 :: HiLow Quiz + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section03.hilowquiz.HiLowQuiz + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLowQuiz.java b/sections/section03/hilow-quiz/src/main/java/org/teachingkidsprogramming/section03/hilowquiz/HiLowQuiz.java similarity index 94% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLowQuiz.java rename to sections/section03/hilow-quiz/src/main/java/org/teachingkidsprogramming/section03/hilowquiz/HiLowQuiz.java index 5993a61b..26f006eb 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLowQuiz.java +++ b/sections/section03/hilow-quiz/src/main/java/org/teachingkidsprogramming/section03/hilowquiz/HiLowQuiz.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section03ifs; +package org.teachingkidsprogramming.section03.hilowquiz; import org.teachingkidsprogramming.recipes.quizzes.graders.HiLowQuizGrader; diff --git a/sections/section03/hilow/pom.xml b/sections/section03/hilow/pom.xml new file mode 100644 index 00000000..a9c8428c --- /dev/null +++ b/sections/section03/hilow/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section03 + org.teachingkids.programming.section03 + 1.0-SNAPSHOT + + hilow + TKP :: Sections :: 03 :: HiLow + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section03.hilow.HiLow + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLow.java b/sections/section03/hilow/src/main/java/org/teachingkidsprogramming/section03/hilow/HiLow.java similarity index 92% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLow.java rename to sections/section03/hilow/src/main/java/org/teachingkidsprogramming/section03/hilow/HiLow.java index 76826d44..5e1e7f46 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/HiLow.java +++ b/sections/section03/hilow/src/main/java/org/teachingkidsprogramming/section03/hilow/HiLow.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section03ifs; +package org.teachingkidsprogramming.section03.hilow; public class HiLow { diff --git a/sections/section03/pom.xml b/sections/section03/pom.xml new file mode 100644 index 00000000..5571f670 --- /dev/null +++ b/sections/section03/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section03 + TKP :: Sections :: 03 + + section03 + pom + + adventure + hilow + hilow-quiz + tests + + \ No newline at end of file diff --git a/sections/section03/tests/pom.xml b/sections/section03/tests/pom.xml new file mode 100644 index 00000000..4fd72b0d --- /dev/null +++ b/sections/section03/tests/pom.xml @@ -0,0 +1,11 @@ + + + 4.0.0 + + section03 + org.teachingkids.programming.section03 + 1.0-SNAPSHOT + + TKP :: Sections :: 03 :: Tests + tests + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/DeepDive03Ifs.java b/sections/section03/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive03IfsTest.java similarity index 98% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/DeepDive03Ifs.java rename to sections/section03/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive03IfsTest.java index 3a7af100..0fe4c6da 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section03ifs/DeepDive03Ifs.java +++ b/sections/section03/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive03IfsTest.java @@ -1,11 +1,10 @@ -package org.teachingkidsprogramming.section03ifs; +package org.teachingkidsprogramming.section04.tests; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; -public class DeepDive03Ifs +public class DeepDive03IfsTest { // How to do deep dive: // Step 1: Select the method name (doesABear on line 20) Press the Run Button diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PrintThis/4_PentagonCrazyWorksheet.docx b/sections/section04/_PrintThis/4_PentagonCrazyWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PrintThis/4_PentagonCrazyWorksheet.docx rename to sections/section04/_PrintThis/4_PentagonCrazyWorksheet.docx diff --git a/sections/section04/digiflower/pom.xml b/sections/section04/digiflower/pom.xml new file mode 100644 index 00000000..67256b44 --- /dev/null +++ b/sections/section04/digiflower/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section04 + org.teachingkids.programming.section04 + 1.0-SNAPSHOT + + digiflower + TKP :: Sections :: 04 :: DigiFlower + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section04.digiflower.DigiFlower + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DigiFlower.java b/sections/section04/digiflower/src/main/java/org/teachingkidsprogramming/section04/digiflower/DigiFlower.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DigiFlower.java rename to sections/section04/digiflower/src/main/java/org/teachingkidsprogramming/section04/digiflower/DigiFlower.java index 9533c577..5c8c614d 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DigiFlower.java +++ b/sections/section04/digiflower/src/main/java/org/teachingkidsprogramming/section04/digiflower/DigiFlower.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section04mastery; +package org.teachingkidsprogramming.section04.digiflower; public class DigiFlower { diff --git a/sections/section04/knottedring/pom.xml b/sections/section04/knottedring/pom.xml new file mode 100644 index 00000000..5b726328 --- /dev/null +++ b/sections/section04/knottedring/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + section04 + org.teachingkids.programming.section04 + 1.0-SNAPSHOT + + knottedring + TKP :: Sections :: 04 :: KnottedRing + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section04.knottedring.KnottedRing + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/KnottedRing.java b/sections/section04/knottedring/src/main/java/org/teachingkidsprogramming/section04/knottedring/KnottedRing.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/KnottedRing.java rename to sections/section04/knottedring/src/main/java/org/teachingkidsprogramming/section04/knottedring/KnottedRing.java index 9aebaef7..57cb2070 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/KnottedRing.java +++ b/sections/section04/knottedring/src/main/java/org/teachingkidsprogramming/section04/knottedring/KnottedRing.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section04mastery; +package org.teachingkidsprogramming.section04.knottedring; public class KnottedRing { diff --git a/sections/section04/pentagon-crazy-quiz/pom.xml b/sections/section04/pentagon-crazy-quiz/pom.xml new file mode 100644 index 00000000..6429db71 --- /dev/null +++ b/sections/section04/pentagon-crazy-quiz/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section04 + org.teachingkids.programming.section04 + 1.0-SNAPSHOT + + pentagon-crazy-quiz + TKP :: Sections :: 04 :: Pentagon Crazy Quiz + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section04.pentagoncrazyquiz.PentagonCrazyQuiz + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazyQuiz.java b/sections/section04/pentagon-crazy-quiz/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazyquiz/PentagonCrazyQuiz.java similarity index 92% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazyQuiz.java rename to sections/section04/pentagon-crazy-quiz/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazyquiz/PentagonCrazyQuiz.java index 658fa392..b8cc4c41 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazyQuiz.java +++ b/sections/section04/pentagon-crazy-quiz/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazyquiz/PentagonCrazyQuiz.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section04mastery; +package org.teachingkidsprogramming.section04.pentagoncrazyquiz; import org.teachingkidsprogramming.recipes.quizzes.graders.PentagonCrazyQuizGrader; import org.teachingkidsprogramming.recipes.quizzes.graders.PentagonQuizAdapter; diff --git a/sections/section04/pentagon-crazy/pom.xml b/sections/section04/pentagon-crazy/pom.xml new file mode 100644 index 00000000..86b3ab84 --- /dev/null +++ b/sections/section04/pentagon-crazy/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + section04 + org.teachingkids.programming.section04 + 1.0-SNAPSHOT + + pentagon-crazy + TKP :: Sections :: 04 :: Pentagon Crazy + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section04.pentagoncrazy.PentagonCrazy + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazy.java b/sections/section04/pentagon-crazy/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazy/PentagonCrazy.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazy.java rename to sections/section04/pentagon-crazy/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazy/PentagonCrazy.java index d489757c..ef1e2d0b 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/PentagonCrazy.java +++ b/sections/section04/pentagon-crazy/src/main/java/org/teachingkidsprogramming/section04/pentagoncrazy/PentagonCrazy.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section04mastery; +package org.teachingkidsprogramming.section04.pentagoncrazy; public class PentagonCrazy { diff --git a/sections/section04/pom.xml b/sections/section04/pom.xml new file mode 100644 index 00000000..b57869e9 --- /dev/null +++ b/sections/section04/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section04 + TKP :: Sections :: 04 + + section04 + pom + + digiflower + knottedring + pentagon-crazy + pentagon-crazy-quiz + tests + + \ No newline at end of file diff --git a/sections/section04/tests/pom.xml b/sections/section04/tests/pom.xml new file mode 100644 index 00000000..c4674845 --- /dev/null +++ b/sections/section04/tests/pom.xml @@ -0,0 +1,11 @@ + + + 4.0.0 + + section04 + org.teachingkids.programming.section04 + 1.0-SNAPSHOT + + TKP :: Sections :: 04 :: Tests + tests + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DeepDive04Mastery.java b/sections/section04/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive04MasteryTest.java similarity index 97% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DeepDive04Mastery.java rename to sections/section04/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive04MasteryTest.java index da98127d..5b72e058 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section04mastery/DeepDive04Mastery.java +++ b/sections/section04/tests/src/test/java/org/teachingkidsprogramming/section04/tests/DeepDive04MasteryTest.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section04mastery; +package org.teachingkidsprogramming.section04.tests; import org.junit.Assert; import org.junit.Ignore; @@ -7,7 +7,7 @@ import you.need.to.fill.in.the.______; -public class DeepDive04Mastery +public class DeepDive04MasteryTest { // How to do deep dive: // Step 1: Select the method name (doesABear on line 20) Press the Run Button diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/PrintThis/5_TurtleTreeWorksheet.docx b/sections/section05/_PrintThis/5_TurtleTreeWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/PrintThis/5_TurtleTreeWorksheet.docx rename to sections/section05/_PrintThis/5_TurtleTreeWorksheet.docx diff --git a/sections/section05/pom.xml b/sections/section05/pom.xml new file mode 100644 index 00000000..4cedb778 --- /dev/null +++ b/sections/section05/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section05 + TKP :: Sections :: 05 + + section05 + pom + + spiderweb + tree-quiz + turtle-tree + + \ No newline at end of file diff --git a/sections/section05/spiderweb/pom.xml b/sections/section05/spiderweb/pom.xml new file mode 100644 index 00000000..71a4d380 --- /dev/null +++ b/sections/section05/spiderweb/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section05 + org.teachingkids.programming.section05 + 1.0-SNAPSHOT + + spiderweb + TKP :: Sections :: 05 :: SpiderWeb + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section05.spiderweb.SpiderWeb + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/SpiderWeb.java b/sections/section05/spiderweb/src/main/java/org/teachingkidsprogramming/section05/spiderweb/SpiderWeb.java similarity index 95% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/SpiderWeb.java rename to sections/section05/spiderweb/src/main/java/org/teachingkidsprogramming/section05/spiderweb/SpiderWeb.java index 7a169686..d6090df5 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/SpiderWeb.java +++ b/sections/section05/spiderweb/src/main/java/org/teachingkidsprogramming/section05/spiderweb/SpiderWeb.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section05recursion; +package org.teachingkidsprogramming.section05.spiderweb; public class SpiderWeb { diff --git a/sections/section05/tree-quiz/pom.xml b/sections/section05/tree-quiz/pom.xml new file mode 100644 index 00000000..5c61656f --- /dev/null +++ b/sections/section05/tree-quiz/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section05 + org.teachingkids.programming.section05 + 1.0-SNAPSHOT + + tree-quiz + TKP :: Sections :: 05 :: TreeQuiz + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section05.treequiz.TreeQuiz + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TreeQuiz.java b/sections/section05/tree-quiz/src/main/java/org/teachingkidsprogramming/section05/treequiz/TreeQuiz.java similarity index 95% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TreeQuiz.java rename to sections/section05/tree-quiz/src/main/java/org/teachingkidsprogramming/section05/treequiz/TreeQuiz.java index 516e2113..e8d7c2a9 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TreeQuiz.java +++ b/sections/section05/tree-quiz/src/main/java/org/teachingkidsprogramming/section05/treequiz/TreeQuiz.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section05recursion; +package org.teachingkidsprogramming.section05.treequiz; import org.teachingkidsprogramming.recipes.quizzes.graders.TreeQuizAdapter; import org.teachingkidsprogramming.recipes.quizzes.graders.TreeQuizGrader; diff --git a/sections/section05/turtle-tree/pom.xml b/sections/section05/turtle-tree/pom.xml new file mode 100644 index 00000000..6841ad6d --- /dev/null +++ b/sections/section05/turtle-tree/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section05 + org.teachingkids.programming.section05 + 1.0-SNAPSHOT + + turtle-tree + TKP :: Sections :: 05 :: Turtle Tree + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section05.turtletree.TurtleTree + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TurtleTree.java b/sections/section05/turtle-tree/src/main/java/org/teachingkidsprogramming/section05/turtletree/TurtleTree.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TurtleTree.java rename to sections/section05/turtle-tree/src/main/java/org/teachingkidsprogramming/section05/turtletree/TurtleTree.java index b3164a9c..650a6901 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TurtleTree.java +++ b/sections/section05/turtle-tree/src/main/java/org/teachingkidsprogramming/section05/turtletree/TurtleTree.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section05recursion; +package org.teachingkidsprogramming.section05.turtletree; public class TurtleTree { diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/PrintThis/6_AdLibsWorksheet.docx b/sections/section06/_PrintThis/6_AdLibsWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/PrintThis/6_AdLibsWorksheet.docx rename to sections/section06/_PrintThis/6_AdLibsWorksheet.docx diff --git a/sections/section06/adlibs/pom.xml b/sections/section06/adlibs/pom.xml new file mode 100644 index 00000000..9b2d43cc --- /dev/null +++ b/sections/section06/adlibs/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section06 + org.teachingkids.programming.section06 + 1.0-SNAPSHOT + + adlibs + TKP :: Sections :: 06 :: Adlibs + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section06.adlibs.AdLibs + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/AdLibs.java b/sections/section06/adlibs/src/main/java/org/teachingkidsprogramming/section06/adlibs/AdLibs.java similarity index 90% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/AdLibs.java rename to sections/section06/adlibs/src/main/java/org/teachingkidsprogramming/section06/adlibs/AdLibs.java index b3b8926a..105b9d82 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/AdLibs.java +++ b/sections/section06/adlibs/src/main/java/org/teachingkidsprogramming/section06/adlibs/AdLibs.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section06modelviewcontroller; +package org.teachingkidsprogramming.section06.adlibs; public class AdLibs diff --git a/sections/section06/pom.xml b/sections/section06/pom.xml new file mode 100644 index 00000000..44d3d142 --- /dev/null +++ b/sections/section06/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section06 + TKP :: Sections :: 06 + + section06 + pom + + adlibs + + \ No newline at end of file diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/PrintThis/7_SimpleBubbleWorksheet.docx b/sections/section07/_PrintThis/7_SimpleBubbleWorksheet.docx similarity index 100% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/PrintThis/7_SimpleBubbleWorksheet.docx rename to sections/section07/_PrintThis/7_SimpleBubbleWorksheet.docx diff --git a/sections/section07/connect/pom.xml b/sections/section07/connect/pom.xml new file mode 100644 index 00000000..04056b33 --- /dev/null +++ b/sections/section07/connect/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section07 + org.teachingkids.programming.section07 + 1.0-SNAPSHOT + + connect + TKP :: Sections :: 07 :: Connect The Dots + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section07.connect.ConnectTheDots + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/ConnectTheDots.java b/sections/section07/connect/src/main/java/org/teachingkidsprogramming/section07/connect/ConnectTheDots.java similarity index 97% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/ConnectTheDots.java rename to sections/section07/connect/src/main/java/org/teachingkidsprogramming/section07/connect/ConnectTheDots.java index a671a5bc..336afdfe 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/ConnectTheDots.java +++ b/sections/section07/connect/src/main/java/org/teachingkidsprogramming/section07/connect/ConnectTheDots.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section07events; +package org.teachingkidsprogramming.section07.connect; import org.teachingextensions.windows.MouseLeftClickListener; import org.teachingextensions.windows.MouseRightClickListener; diff --git a/sections/section07/pom.xml b/sections/section07/pom.xml new file mode 100644 index 00000000..0455d365 --- /dev/null +++ b/sections/section07/pom.xml @@ -0,0 +1,19 @@ + + + + 4.0.0 + + sections + org.teachingkids.programming + 1.0-SNAPSHOT + + org.teachingkids.programming.section07 + TKP :: Sections :: 07 + + section07 + pom + + connect + simple-bubble + + \ No newline at end of file diff --git a/sections/section07/simple-bubble/pom.xml b/sections/section07/simple-bubble/pom.xml new file mode 100644 index 00000000..28ce4cc3 --- /dev/null +++ b/sections/section07/simple-bubble/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + section07 + org.teachingkids.programming.section07 + 1.0-SNAPSHOT + + simple-bubble + TKP :: Sections :: 07 :: Simple Bubble + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + org.teachingkidsprogramming.section07.bubble.SimpleBubble + true + lib/ + + + + + + + diff --git a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/SimpleBubble.java b/sections/section07/simple-bubble/src/main/java/org/teachingkidsprogramming/section07/bubble/SimpleBubble.java similarity index 96% rename from TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/SimpleBubble.java rename to sections/section07/simple-bubble/src/main/java/org/teachingkidsprogramming/section07/bubble/SimpleBubble.java index f91a4e41..a85355d8 100644 --- a/TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/SimpleBubble.java +++ b/sections/section07/simple-bubble/src/main/java/org/teachingkidsprogramming/section07/bubble/SimpleBubble.java @@ -1,4 +1,4 @@ -package org.teachingkidsprogramming.section07events; +package org.teachingkidsprogramming.section07.bubble; import org.teachingextensions.windows.MouseLeftClickListener;