CSE 115 - Fall 2008 - Banner
UB -
University at Buffalo, The State University of New York Computer Science and Engineering
  • CSE 115 - Fall 2008
CSE 115 - Fall 2008 - Navigation
CSE 115 - Fall 2008 - Lab 6

Lab 6
Last modified: October 13 2008 08:15:37 AM

- - Lab 2

Introduction

This lab will have you writing a graphical program that reacts when the user interacts with it. This program will be an application (stand-alone) program, that is, you will not need the DrJava Interactions pane to run the program. Also, you can decide how much of the program you would like to implement. Your choices will determine your possible maximum grade, but you do have the opportunity to earn more than 100 points on this lab assignment.


Objectives

We will concentrate on the following idea that was discussed in class:

  • ActionListeners
  • Drawing graphics to the screen
  • Programs that react to user actions

There will also be a review of the following two concepts previously covered:

  • Defining classes
  • Graphical components from javax.swing package
  • Creating objects
  • Calling methods
  • References


Lab Tasks

Eclipse Project Setup

Check out the Lab6 Skeleton from the repository. This skeleton is basically the same as the one for Lab 5. You need to create a package for your code inside this project. You will also need to create Java source code files and put them inside this package.

Attendance

Attendance will be taken for this lab and will count towards part of this lab's grade.

Design

You will need to design your solution using UML before you begin coding. You will also be required to submit a UML diagram named Lab6.grn with your final submission.


Assignment Description

Basic Implementation (Maximum Grade of 85 possible)

Create a program that contains a drawing canvas. When the user clicks on the drawing canvas with the mouse, a shape (ellipse or rectangle) appears. You (the programmer) will select the color the shape appears in as well as what size the shape appears. Both of these can be the same for every shape that is created. The TAs will discuss this week in lab about using a mouse listener to have the drawing canvas react to mouse clicks in this manner.

Advanced Implementation (Maximum Grade of 100 possible)

The basic functionality of above is maintained, except the program allows the user to select from a set of possible color choices for the shape. There should be at least four different color choices for the shape, shown to the user in some reasonable way on the graphical interface. In the last half hour of lab this week, the TAs will go over some ideas for how to implement this type of behavior.

Beyond Advanced Implementation (Maximum grade of 115 possible)

You will implement the basic functionality as described above as well as the advanced functionality. However, you will change the color selection mechanism so that when the user wants to select a color, they select a color from the JColorChooser component. Also, the user should be able to specify a size for the shape (both length and width). Use either two JSliders or two JSpinners to allow the user of the program to select a size for the shapes.


Due dates

The Lab6.jar must be submitted using the electronic submission command the evening before (11:59:59pm) your next lab session, the due dates are summarized in the table below. Note that your submission must include your Java source code files as well as a file that contains your UML diagram.

Recitation Normally Meets on Assignment due on
Tuesdays Monday, October 20
Wednesdays Tuesday, October 21
Thursdays Wednesday, October 22
Fridays Thursday, October 23

 


CSE 115 - Fall 2008 - Footer

Page maintained by Adrienne Decker

Contact: adrienne@cse.buffalo.edu | 130 Bell Hall | (716)645-3180 x 161