JMU CS349 - Developing Multimedia
Gallery Help Policies Solutions Study-Aids Syllabus Tools
Programming Assignment 5


1 Purpose

The primary purpose of this assignment is to help you review (and demonstrate that you have acquired) the knowledge and skills required to create a program that uses static visual content (both sampled and described).

2 Background

As you know, WeatherBits is a (fictitious) company that is developing and commercializing applications that will use localized, high-resolution weather forecasts. For this assignment, you must implement an application that can be used to display weather observations and forecasts on a map.

3 Documents

WeatherBits uses a heavyweight process (as opposed to an agile process) so they have created a fairly detailed set of specifications. They are described in the following document:

4 Submission

There is a two part submission process for this assignment.
  1. You must also submit (using Gradescope) a .zip file containing all of the code necessary to build your application. Gradescope will only be checking to ensure that your code complies with the course style guide. Hence, you may only submit to Gradescope five times. If you can't get your code to comply with the course style guide within five submissions, you will receive a grade of 0 on the assignment.
  2. You must submit (using Canvas) an executable .jar file named StaticMapApplication.jar (that must NOT contain any of the classes in multimedia2.jar ).

5 Grading

You will receive one of four grades on this assignment -- 100, 75, 50, or 0. You will receive a grade of 100 if your code is essentially correct (i.e., a limited number of system tests do not cause any failures). You will receive a grade of 75 if you appear to have devoted significant effort to the assignment but your code has small defects. You will receive a grade of 50 if you devoted a reasonable amount of effort to the assignment but your code has major defects. You will receive a grade of 0 otherwise and/or if the code you submit to Gradescope code contains any style defects.

Gradescope will assign a maximum grade of 25 (based solely on style). Points will then be awarded manually based on the criteria discussed in the previous paragraph.

6 Help

You might find the following tips/hints helpful.

6.1 Getting Started

You might want to start by making sure you understand the following LogoApplication class:
/**
 * An application that displays a logo.
 */
public class LogoApplication extends WeatherBitmapsApplication
{
  private LogoBoard logoBoard;
  
  /**
   * Explicit value constructor.
   * 
   * @param args   The command line arguments
   */
  public LogoApplication(final String[] args) throws IOException
  {
    super(args);
    logoBoard = new LogoBoard(WIDTH, HEIGHT-60);
  }
    
  /**
   * Get the GUI component that will be used to display the weather information.
   * 
   * @return The WeatherObserverPanel
   */
  @Override
  protected JComponent getGUIComponent()
  {
    return logoBoard.getView();
  }
  
  /**
   * Get the WeatherObserver to inform of changes.
   * 
   * @return The WeatherObserverPanel
   */
  @Override
  protected WeatherObserver getWeatherObserver()
  {
    return null;
  }
  
  /**
   * Construct and invoke  (in the event dispatch thread) 
   * an instance of this JApplication.
   * 
   * @param args The command line arguments
   */
  public static void main(final String[] args) throws IOException
  {
    JApplication app = new LogoApplication(args);
    invokeInEventDispatchThread(app);
  }
}
      
    

It makes use of the following LogoBoard class that is a Visualization that adds a single piece of visual.statik.sampled.Content (containing the logo) to itself.

package gui;

// Java libraries
import java.io.*;

// Multimedia libraries
import io.*;
import visual.*;
import visual.statik.sampled.*;

// Application libraries
import resources.Marker;


/**
 * A Visualization that can be used to display a logo.
 */
public class LogoBoard extends Visualization
{
  private ResourceFinder jarFinder;
  
  /**
   * Explicit Value Constructor.
   * 
   * @param width The width of this component (in pixels)
   * @param height The height of this component (in pixels)
   * @throws IOException if something goes wrong
   */
  public LogoBoard(final int width, final int height) throws IOException
  {
    super();
    
    jarFinder = ResourceFinder.createInstance(new Marker());

    VisualizationView view = getView();
    view.setBounds(0, 0, width, height);
    view.setSize(width, height);

    ContentFactory contentFactory = new ContentFactory(jarFinder);
    Content logo = contentFactory.createContent("logoWeatherBits.png", 4);
    logo.setLocation(0, 0);
    add(logo);
  }

}

6.2 Graying-Out the Watermark

As mentioned in the specifications, the .jar file must contain the WeatherBits logo in "color", it must not contain a gray-version.

You can gray-out the "color" version using a BufferedImageOp.

6.3 Polygons

The easiest way to create a Shape object from geographic boundary files is to use a Path2D.Float or Path2D.Double object.

6.4 Reading Weather Icons

The easiest way to read individual weather icons is to use a visual.statik.sampled.ImageFactory object.

Copyright 2025