JMU CS446 - Software Analysis and Design
Help Policies Solutions Study-Aids Syllabus Tools
Programming Assignment 3


1 Purpose

The purpose of this assignment is to implement the functionality associated with opening documents and quitting in the application framework, and to use this functionality in the demonstration application, The Big Pixel.

2 Learning Objectives

This assignment will help you learn about (and demonstrate that you have learned about) several design patterns, internationalization/localization, worker threads, and inner classes.

3 Starting Point

As in the past, you may start with either your solution with the solution that you were given.

4 Documents

The UML class diagram is available as an SVG file at:

The specifications are available as a PDF file at:

The main class (that can be used for integration testing) is available at:

The use case descriptions for how the demonstration application must behave are available at:

5 Resources and Other Files

The following .properties files should contain all of the phrases needed to support both English (U.S.) and French (France):

You must:

  1. In a file explorer, select the files and copy them.
  2. In the Eclipse Project Explorer, create a new "Source Folder" named resources in the project.
  3. In the Eclipse Project Explorer, paste the files you copied into the resources "Source Folder". (Do not paste them using the file explorer.)

If there are phrases missing, make sure you contact me.

The following .zip file should contain all of the icons needed by the application framework and the demonstration application:

They were provided courtesy of the Google Material Design Project. Other icons can be downloaded from that project as needed. You must:

  1. Unzip them into a directory/folder that is unrelated to Eclipse or your project.
  2. Select the files in a file explorer and copy them.
  3. In the Eclipse Project Explorer, create the package edu.jmu.cs.academics.resources.
  4. In the Eclipse Project Explorer, paste them into the package edu.jmu.cs.academics.resources. (Do not paste them using the file explorer.)

The following .zip file contains some .bpx files that you can use when executing the demonstration application:

They can be unzipped anywhere on the file system.

6 Tasks

For this assignment you must:
  1. Implement all of the interfaces and classes in the class diagram and specifications document.
  2. Write JUnit tests for many of the classes in the class diagram and specifications document.

7 Testing

Your JUnit test suite must cover 75% of all statements and all branches (as measured by EclEmma) in the various classes other than the AbstractEditableReadingWorker, AbstractModalDialog, BackgroundTaskDialog, BigPixelEditor and GridComponent classes. (This includes classes from earlier assignments.) Your tests must be in a package named edu.jmu.cs.academics.testing and each test class must include the word "Test" in its name.

8 Files for Testing

The text file that you must use to test the StringReadingWorker class and the OpenString class is available at:

You must use this file because it will be made available to your code in the appropriate place on Autolab. You must drag this file from a file explorer into Eclipse (in the project project directory, not the src directory). Do not copy the file outside of Eclipse.

You must not use any of the .bpx files in your unit test. They must be used only for integration testing.

9 Submission

You must submit (using Autolab) a .zip file named pa3.zip that contains:
  1. Your implementation of the required interfaces/classes/enums in the appropriate package(s), including those from previous assignments.
  2. JUnit tests for all of your classes/interfaces.

Do not submit the main class and do not submit any data files (e.g., default.cfg, stringdocument.txt, or any .properties files).

You must submit (using Canvas) one PDF file that contain screenshots of The Big Pixel after you have opened a .bpx file.

10 Grading

Your submission will be graded as follows:

11 Help

The following help topics may be useful to you.

11.1 Throwing a HeadlessException on Autolab

Autolab runs on a server that does not have a graphical display. Hence, any method you invoke that needs to use a graphical display will throw a HeadlessException.

Given that you should not be unit testing any of the GUI components, the most likely cause of such an exception is the construction of a Frame or JFrame object (e.g., in the testing of your Quit or OpenString class. You should be able to use null (in place of a Frame or JFrame) for the parent component without causing any problems.

11.2 Some Early Integration Testing

You can use the AbstractLocalizedAction, AbstractDocumentAction, and Quit classes in The Big Pixel (even if you haven't stubbed-out the other classes) by commenting out the part of the setupMenu() method in the main class that constructs and uses the OpenString object named open.

Copyright 2022