Final Project
Due 5:30pm Monday 5th. 

Final project option 1: TronScan (Intermediate)
See TronScanBase.tar on course website under homeworks

All the values on the configuration screen are stored in a file called tronscan.config that will be located in the same directory as the executable jar file once you deploy to production.  Be careful to leave this configuration file in a different package during developments since leaving it in the same package as your source code can cause problems for eclipse.  If you look in the examples package, you will see an application called ConfigFile.java.  This application has all the code you need to implement this functionality. 
If any values in the configuration file not yet been set, then clicking the start button will write out the values from the text boxes in the configuration tab to the tronscan.config file, while preserving any data-- for example the e-mail addresses of the students.  If any data has been updated, then the configuration file will reflect those updated fields (upon clicking start), while preserving any unchanged data, including e-mail addresses. 
In the configuration tab you will see a browse button.  This activates a file chooser that allows the user to navigate to a directory on their local system. The path to this directory corresponds to the imgpath entry in the configuration file. 
This directory is the location of the raw scanned forms, including the master.  The master scan, which is the scan that contains the correct answers for the exam, must be called master.jpg.  Students scans need not follow any naming convention whatsoever, but they must be located in the same directory. 
Next, the user will have the option to determine who will be emailed.  As with previous text field, if there is already data in the configuration file for the examiner's email, then this text field will be populated automatically when you read in the data from the configuration file.  If neither of the first two check boxes are selected, then the examiner's email address text field should not be editable.  The first check box will e-mail a results-JPEG (you can see generally what the result should look like by experimenting with the buttons for testing tab; I will discuss in detail what is required below).  This results-JPEG will be stored in the same directory as the source-scan, and it will have a name that begins with an underscore, then the students lastName, then first initial, then the course number.  For example, if John Smith were to take exam 051036202, then the resultants-JPEG would be called _smithj051036202.jpg. 
In addition to generating result-JPEGs for each student, you'll need to generate one excel file with a table containing as much data as you can reasonably extract from the forms, including, student lastName+firstIniital, total number of questions, number correct, number incorrect, and percentage score.  This excel file is generated and stored in the imgpath directory. 
You also need to generate an activity log as a text file with a .log extension.  If this process were run at 5:30pm on Monday, November 14, then the name of this file, using the same example as above, would be called log051036202_201111141730.log.  The examiner may choose to have this log e-mailed to himself.  At minimum, you must generate this log file after each successful or interrupted process.  The log file contains at least as much data as the excel spreadsheet, with more detailed system-level data, including if the e-mails with attachments were successful, when these emails were sent, etc.  If the user aborts during the process, then the log file needs to reflect this. 
The last check box is to allow the examiner to e-mail students with a brief message and an attachment of their resultants-JPEG. 
Clicking on the edit email list button, pulls up a notepad application that you write in java (there are many examples on the Internet and you may borrow up to 100% of that code--so long as you cite the source-- when implementing the java notepad app that is specific to this appliation; there is a Notepad.java class in the examples package already) that opens the tronscan.config file for editing. 
You will need the Java Mail library to do mailing. //http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.4-oth-JPR
//then add this to the build path.
Processing images:
When the user clicks to start, the process begins and the progress bar which is located below the tabbed pane on the left, displays the progress.  In the examples package, you will see a java file called ProgressBarDemo.java. Here is some generic psuedocode that corresponds to clicking the 'Start' button; keep in mind that this is not a detailed algorithm. 
//write data from fields in config tab to tronscan.config 
//close datastream to tronscan.config
//hide start button
//show abort button
//start the progress bar SwingWorker
//read in the data from the config file to a hashmap
//instantiate an Exam object to store the master exam data
//open an outputstream to a log-file  (prepare to write)
//open an outputstream for an excel file (prepare to write)
//attempt to find the master.jpg file in the imgpath directory
	//if if does not exist, 
		//stop process (write that to log, close open streams,  etc.)
	//else
		//record the course number for the exam
		//for each answer
		//if all five chads are not filled-out (no marks)
			//answer is marked as inactive (see field in Answer class).
		//store answers in an array of Answer[100]

note: the array of Answer[100] should belong to a seperate class called Exam. 
		
//for each jpg in imgpath that is neither the master.jpg nor the a jpg that starts with underscore
	//shift the hue to purple of the results buffered img
	//read lastName+first initial, courseNumber, Answers 
	//Instantiate a new Exam object and store data there, including an Array[100]
	//add that exam to an ArrayList<Exam>
	//for each answer in the master exam
		//if the answer is active (has a mark) on master
			//if student answer != master answer
				//mark a red box on the student results-img at spot
			//else
				//mark cyan box on the student results-img (over their answer)
	//echo (write) the lastname + firstInitial of student on the img in red 
	//echo (write) the course number on the img in red 
	//calc and write the percentage correct
	//write the number correct
	//write the number incorrect
	
	//add data to excel file
	//add data to log file
	//save bufferedImage as jpg using naming convention described above

	//if email instructor jgp report is checked. 			
		//email the instructor the jpg report as email attachement
	//if email students jgp report is checked (use hashmap to get value using key)
		//email the student his/her exam results jgp only with a nice message.

note: if process is interrupted by an exception,  write the exception message to the log-file.  If the process is interrupted by the user, then state that in log-file Close any open outputstreams to excel files or log files. show dialog box with very breif log. 

//Close any open outputstreams to excel files or log files. 
//if email activity log and spreadsheet to examiner is checked
	//email activity log and spreadsheet to examiner (get email from hashmap)

//show start button
//hide abort button
//system.beep() 
// display dialog box (JOptionPane) with a very brief report of the process; successful/unsuccessful, how many processed, name of exam, etc. 

The algorithm for finding answers is already implemented for you.  You'll need to implement the algorithm that finds the lastName and firstInitial of the student.  You'll also need to implement an algorithm that reads-in the course number. 
The tronscan forms provided are for prototyping and proof-of-concept only; they are not to be used in any sort of production software as they, despite already being much altered, too closely resemble original proprietary forms. If you chose to implement TronScan, break out your favorite image editor and create an original compatible TronScan form.  
The forms provided to you are scanned at 92dpi. That seems to be a good resolution for a working application. 

Final project option 2: Asteroids (Advanced)
See AsteroidsBase.tar on course website under homeworks

The objective for this game is simple.  You are provided with a game that has some basic functionality already.  
At minimum you must implement the functionality found here: http://www.springfrog.com/games/asteroids/
That includes:
1/  expolding sprites into debris and fading debris.
2/ playing sounds when you fire
3/ UFO appears and fires at you
4/ difficulty increases each level clear; which means more asteroids and more frequent appearance of a UFO
The most difficult aspect of this game is collision detection.  Do some research on collision detection on google to deterine the best algorithm. 
You may also have any number of power-ups.  This includes things like shields, special weapons, temporary invincibility. 
You may also include a hyperspace functionality, but protect your falcon upon re-entering (like when a level starts). 
Please keep in mind that of the two choices,  TronScan or the Asteroids game, this is advanced. 
Some constraints: 1/ you must extend the codebase provided to you, though you may refactor it as you wish. 2/ Definitely get inspired by others' code (and cite when appropriate), but don't copy every line of code and pass it off as your own.
Good luck.