Softball Statistician
Personnel
Goeing, Matt
Hunter, Ryan
Wicker, Rick
CS499 University of Kentucky May 2008
Disclaimer:
This project has been designed and implemented as a part of the requirements for CS-499 Senior Design Project for Spring 2005 semester.
While the authors make every effort to deliver a high quality product,
we do not guarantee that our products are free from defects.
Our software is provided "as is," and you use the software at your own risk.
We make no warranties as to performance, merchantability, fitness for a particular purpose, or any other warranties whether expressed or implied.
No oral or written communication from or information provided by the authors
or the University of Kentucky shall create a warranty.
Under no circumstances shall the authors or the University
of Kentucky be liable for direct, indirect, special, incidental,
or consequential damages resulting from the use, misuse, or inability
to use this software, even if the authors or the University
of Kentucky have been advised of the possibility of such damages.
Abstract
The Softball Statistician is a program designed for the NicholasCountyHigh School's softball team. It is intended to provide easy management of the softball team's stats
for each season. The program provides sortable individual game stats as well as season totals for the team and each player. Each table may be printed and each season's worth
of data may be easily saved into a single file for simpleorganization. The single file also allows for the filesto be emailed without much hassle.
Introduction
Need: The current method for recording and maintaining softball records
and statistics at NicholasCountyHigh School is by paper and pencil. This can be a time consuming process when reports need to be created or statistics calculated. Written records can also be difficult to search and maintain. The current price of such commercial software products is greater than $500 and cannot truly be justified.
Solution: Software shall be created that provides the coaches of NCHS the ability to maintain accurate softball records. The software shall allow the coaches to enter player statistics on a game by game basis. The interface shall allow the user to generate and print reports based on particular games, players, or for the entire season. The user shall be able to access previous games' statisticsand a 'season' statistics page that is updated and kept current with the games entered
Specifications
Details:Max number of games in a season: 45
Player Statistics:
Name
Grade
At Bats (AB)
Hits (H)
Runs (R)
Runs Batted In (RBI)
Errors (E)
Batting Average (Ave)
Doubles (2B)
Triples (3B)
Home Runs (HR)
Strike Outs (SO)
Walks (W)
Game Statistics:
Score
Opponent
Team Statistics
Season Statistics:
Record
Total Player Statistics
Total Team Statistics
Planning
Platform
Programmed entirely in Java.
Designed for any machine supporting the Java Virtual Machine.
Objective Interaction and Data Flow
The Program is most easily broken up into three different parts.
The first part is the GUI which is responsible for user
interaction as well as printing the data. The second part is
the Engine which provides the GUI with the requested data and
does some error checking. The last part is best described as
data storage. Data storage involves both the data as it is
stored while the program is running and when saved to disk.
February 10
-Webpage with specification due.
-Small meeting to discuss initial design.
February 24
-Complete Basic Design is Finished(only minor tweaking left).
February 28
-Customer has Oked initial GUI design and slight modification to specfications.
March 8
-Midterm Presentation
-Project Design Due to be put on webpage.
March 10
-Meeting to Discuss Work that still needs to be done.
March 29
-Group Meeting
-All code outside of GUI should be done(Engine, Game, Player).
-Enough code to fully test the GUI is Done.
April 5
-Group Meeting
-All code should be done and ready for final heavy testing.
-Code was done except for Read/Write and a couple statistics computation
April 1-15
-Code Review with Instructor
-Instructor was pleased except for he desired more comments in out code
April 21
-Final Project Presentation
April 23
-Group Meeting
-Fixed the minor remaining bugs
-Everything involving the code is Finished
April May 4
-Project Completed All deliverables done.
Design
GUI
The GUI is meant to be simple and intuitive. It will consist
of large viewing table that will show the data for the
selected game and allow for altering it and a pane for
selecing which game to view as well as save/load file buttons.
The GUI is created using SOftBallTableModel and SoftBall table
classes.
Engine
The Engine is designed to process all requests from the GUI. The
Engine checks all input to make sure they are integers. The
Engine uses an array of Game objects to hold the data during
runtime.(Engine.java)
Data:
game Season[45]array of game objects
int year
string hometeamname
numofPlayedGames
Methods:
void readData(string filename);
void saveData(string filename);
string getOpponent(int gameNum)
int getHomeScore(int gameNum)
int getOpponentScore(int gameNum)
object getData(int gameNum); This returns the data for one game
in a two dimensional array.
void setatBats(int gameNum, string name, int atbats)
…(all set functions)…
void setopponent(int gamenum, string opponent)
void editName (String oldName, String newName)
void newGame() //effectively flip the gameplayed bool in next
game in games array
Data Storage
The Data is stored in Game and Player Objects during runtime and
saved to a file (one file per season) for long term storage.
Game(Game.java):
Data:
player Roster[25]array of player objects
string opponent
int opponentScore
int homeScore
int numofPlayersonRoster
bool gamePlayed
Methods:
string getOpponent()
int getHomeScore()
int getOpponentScore()
bool gamePlayed() //returns whether or not game has been played
object getGameData();
This should return a double array like:
Object Data[][] = Game.getGameData();
Data will then be
{{"player name","grade", atBats, runs,..,walks},
{"player name","grade", atBats, runs,..,walks},
…
{"player name","grade", atBats, runs,..,walks}}
getGameData will in effect, return an array of arrays of player
data for the game.
**basically an array of the data return by calling getPlayer()
on ever player in the game.
void setatBats(string name, int atBats)
...(all set functions)...
void setStrikeOuts(string name, int strikeouts)
void setGamePlayed(bool play);
void addPlayer(string name) //flip the playedinGame bool for
the next player in the array to true and set their name,
increment numofPlayersonRoster
int getNumofPlayers() returns numofPlayersonRoster
Player(Player.java):
Data:
string name
string grade
int atBats
int runs
int runsBattedIn
int errors
int doubles
int triples
int homeruns
int strikeouts
int walks
bool playedinGame; //initialise to false so that when checkin
the game object array of players if this is false there is
no data for this player object
Methods:
object getPlayerData();
should return an array:
{"player name","grade", atBats, runs,..,walks}
bool played(); return playedinGame
void setName(string name)
...(all set functions)..
void setStrikeOuts(int souts)
void serPlayedinGame(bool play);
File Handling:
The save file(.sfb file) systems uses the serializable
interface of java to save individual player and game objects
to file. This allows us to encrypt the files in byte format
to prevent easy access and also makes for more streamlined
reading and writing. It also makes coding and debugging more
efficient due to the ease of reading the code as objects
instead of the individual statistics. Reading is also very
similar in that the objects are created in full as opposed
to being initialized and built with several member functions.
Extra constructors were added for both the player and game
objects to assist in the I/O from the external files. The
file itself begins with the number of games in the season
information. This is followed by the saved game objects of
the games and then the players
User Scenarios
User Screens
5/4/05
The user will be able to enter data for all of the games in a single season. The entire
season will be saved in a single file. The individual games and the season total will be
listed on the left hand side of the GUI based upon the opponent and date that the user enters
into the panel for each game. The panel is located above the table and like the table, will be
unique to each game and will be updated if the user selects a different game in the list.
Design Considerations
+One major design consideration was to keep the program
simple and easy to manage so that only minor computing
experience is needed to begin using it.
This led to several design choices:
-Not to use a database because the user would be
unfamiliar with setting one up and the program
is intended to be able to be installed on
multiple machines by the user.
-Keep the GUI simple and intuitive.
-Attempt to keep the save file easily manageable
so the user can email and move them from place
to place.
+Java programming launguage was chosen because it allowed
for a fairly easy GUI setup and all of the programmers
were familiar with it.
+The program will intially be developed for softball only
but then potentially altered to allow for easy
implementation of other sports. This was done so that the
customer's needs should definantly be able to be met while
allowing for the project to be extended time permitting.
JAVADOC
Future Enhancements/Maintenance
KHSAA-Current Implementation is to have the coach call and deliver stats in
order to keep up with statistical leaders.
Other Sports
-This program can be easily transferable to other sports. The NicholasCountyHigh School Football Coach has already requested its use.
Test Strategy
-A beta version was given to the customer in mid April for practical use testing. No major errors were found. The screen size of the user was smaller than the size we had for the program, so we had to modify the screen dimensions of the final project. Also on the printout, there was a column that was not wide enough. Some of the data was not being displayed. Both of the problems were fixed.
-All of the other testing was done by the programmers. We set up a strategy for testing the boundary conditions (by entering the maximum # of players for each game and the maximum # of games for the season). We also tested usability errors such as randomly clicking buttons, trying to enter data on uneditable screens, printing, etc.
-We also had former softball players who were friends with the group to run the program on their own computers and report any errors. No errors were reported.
References
User's manual and installation guide
- Included
- Insert Program CD into CD drive. Autorun will read the CD and install the necessary compononents.
User’s Manual
Version 1.0
Authors: Matt Goeing, Ryan Hunter, Rick Wicker
Table of Contents
Program Layout…………………………………………………………………3
Game List…………………………………………………………………3
File Menu/Icon Bar………………………………………………………3
Game Data……………………………………………………………….4
Commands……………………………………………………………………….6
Open the Program………………………………………………………6
Exit the Program…………………………………………………………6
Create a New Season…………………………………………………...6
Open an Existing Season………………………………………………6
Save a Season…………………………………………………………..7
Add a New Game to the Season………………………………………7
Delete Last Game……………………………………………………….8
Print Game Information…………………………………………………8
Displaying About Screen……………………………………………….9
Edit Game Information………………………………………………….9
Adding a Player to the Game………………………………………….. 10
Deleting a Player from the Game……………………………………... 10
Edit Game Statistics…………………………………………………… 11
Highlights………………………………………………………………………… 12
PROGRAM LAYOUT:
-Game List – This area will display a list of games in the current season. To display a different game, the user simply needs to click on the game in this list. Users can update this list using the ‘New Game’ and ‘Delete Last Game’ Button.
-File Menu/Icon Bar – This area will give the user options such as ‘Save Season’, ‘Open Existing Season’, etc.
-Game Data – This area will display all of the information for the game that is selected in the Game List.
The upper portion will contain game logistical information: opponent, site, opponent score, home score, and date.
The lower portion is the table that will display the game statistics.
-COMMANDS
-Open the program
Click on the SoftballStatistician.jar file located on your desktop.
-Exit the program
To close the program the user has three options:
1) click File-> ‘Exit’
2) press Alt + F, then Alt + E
3) click on the red ‘x’ in the upper right-hand corner.
*Be sure to save before you exit! Under the current version, you will not be prompted to save before you exit.
-Create a New Season
To create a new season the user has two options:
1) click File-> ‘New Season’
2) press Alt + F, then Alt + N
-Open an Existing Season
To open an existing season the user has three options:
1) click File-> ‘Open Season’
2) press Alt + F, then Alt+ O
3) click on the ‘Open File’ Button:
Browse to find the saved file and click “Open’ or click ‘Cancel’ to cancel any actions.
-Save a Season
To save a season the user has three options:
1) click File-> ‘Save Season’
2) press Alt + F, then Alt+ S
3) click on the ‘Save File’ Button:
Type a name for the file and select the directory to save the file. Click ‘Save’ or click ‘Cancel’ to cancel any actions.
Each saved file represents a ‘Season’. It will save a Season with a maximum of 45 games each with a roster of up to 26 players.
-Add a New Game to the Season
To add a new game to the current season click the ‘New Game’ Button in the lower left hand corner:
.
This will add another item to the Game List as ‘New Game’. To change ‘New Game’ to something more useful, type in the opponent’s name in the blank box:
Whatever is typed into the ‘Opponent’ Box will replace the highlighted item in the game list.
For example, typing ‘Nicholas’ into the ‘Opponent’ Box will yield the following results:
The roster from the previous game will be set as the roster for the New Game so that the user doesn’t have to add each of the players again.
-Delete Last Game from the Season
To delete a game in the current season click the ‘Delete Last Game’ Button in the lower left hand corner:
This will delete the last game in the list. This is not intended for use to delete more than one game at a time. This is simply a convenience method in case the user wishes to delete the last game and start again. This button will only allow the user to delete one game. A new game must be created in order to be able to delete again.
-Print Game Information
To print game information the user has three options:
1) click Reports-> ‘Print Game’
2) press Alt + p, then Alt + t
3) click on the ‘Print Game’ Button:
A print preview will appear for the game that is highlighted in the Game List:
Press the ‘Print’ button at the bottom to print the game data or press cancel to return to the program.
-Displaying the About Screen
To display the ‘About’ Screen the user has two options:
1) click ‘Help’-> ‘About’
2) press Alt + H, then Alt + A.
-Edit Game Information
To enter game logistical information (opponent, score, date, site) simply type this information into the text boxes with the corresponding game highlighted in the Game List. (If ‘Season Totals’ is highlighted in the Game List, the user is unable to edit any of the game information.
-Adding a Player to a Game
Select the game from the Game List that you wish to add the player. Click the ‘Add Player’ Button in the upper right-hand corner:
.
This will display a box to enter the player’s name:
.
Type the player’s name into the box and press the ‘OK’ button or the ‘Enter’ to key add that player or press the ‘Cancel’ button to return to the program. Pressing ‘OK’ will add a player to the current game and all future games.
-Deleting a player from a game
Select the game from the Game List that you wish to delete the player. Click the ‘Delete Player’ Button in the upper right-hand corner:
.