In this lab, we will actually be writing some Java code that will be executed in the DrJava interactions pane.
You will be interacting with the DrJava interactions pane and executing some Java code that you will write. We will concentrate on the following two ideas that were discussed in class:
Check out the Lab2 Skeleton from the repository. You will not be editing any of the Java files in the Lab 2 skeleton, but if you are interested in how any of the code works for Lab 2, you are more than welcome to look at the code that you check out from the skeleton. You will type all the code for this assignment into the DrJava interactions pane and observe the results. You will be submitting a transcript of what you typed into the interactions pane as described below.
There are a few things available to you in the interiordecorator package. There is a interiordecorator.Room class. This represents a room that you can decorate.
You will need to create the following objects and call the following methods to complete the lab.
interiordecorator.Room
object. You can specify a color for the room by creating a new color object in the ()
when you create the roomaddCurtains,
and specify a color for the curtains by creating a new color object in the ()
of the method callCouch
, Lamp
, Plant
, Table
) by calling the add method on the room you created.setLocation
), change its size (setDimension
), or for some really funky rooms: change its rotation (setRotation
).
You will see a file in your Lab 2 project named DrJavaInteractions.txt
. Double-click to open the file in the editor. Highlight all of the text in the DrJava interactions pane and copy it. Paste it into the DrJavaInteractions.txt
file where indicated. Make sure to put your name in the DrJavaInteractions.txt
file where indicated. Save DrJavaInteractions.txt
. BE SURE TO COPY AND PASTE YOUR WORK BEFORE YOU CLOSE THE ROOM WINDOW!
You need to show your TA the results of your work on the room. If you are able to complete all of the tasks during the lab time, show the TA your finished room. If you are not, before you leave, make sure you show the TA the progress you have made on the room. Attendance will not be given for simply showing up and spending a few minutes on the lab and then leaving to do it later. Use the recitation time to complete as much of the assignment as you can (you will most likely finish it) and to be sure you understand what steps you are performing to complete the lab tasks.
You will submit the project for Lab 2 using the Web-CAT Eclipse submission tool in the same way you did for Lab 1. If you do not remember how to submit, please refer back to those instructions. Your completed submission is due to be received by 11:59:59pm, Sunday, February 7th.
If you are attempting to work at home, you will need to make sure you have the image files couch.gif
, lamp.gif
, potted-plant.gif
, and table.gif
in a directory on your system named /projects/CSE115/Images
where /projects
is in your root directory (probably C:\
if on a Windows system). You can get the files by using a file transfer client (like Filezilla). The image files are located on the server (timberlake.cse.buffalo.edu
) in a directory named /projects/CSE115/Images
.
Images from http://free-clipart.net/, http://www.webweaver.nu/, and http://classroomclipart.com
Lab authored by Adrienne Decker
Page maintained by Adrienne Decker
Contact: adrienne@buffalo.edu | 130 Bell Hall | (716)645-3184