Lab8


What We're Gonna Do:

In this lab, you will build a visualizer to visualize a dictionary in GUI (Graphics User Interface). This visualizer will allow you to dynamically change bindings between data and presentation -- an object-oriented kind of visualizer.

OOA/OOD

This visualizer will visualize one collection of data in a dictionary using bar chart. The height of each bar corresponding a value in that set. So we will have two classes, Visualizer and Bar.

Visualizer

I am a Visualizer. I know which dictionary I am visualizing. I know all the bars I am using. I set their heights and colors after I am specified which collection in that dictionary I will visualize. I will tell those bars to display themselves.

Bar

I am a Bar. I know my height and color and position. I can set my height and tell the others my height if they want to know. I know the order of me in these bars. I can display myself.

OOP

Now file in Visualizer.st. In the Workspace type Visualizer demo and do it. You will see several bars pop up!

Now read the code carefully before you begin to start your job.

Explanations of given code:

In the class method demo of Visualizer, at first a dataset as an array was formed. You feed the dataset to the Visualizer then tell it what binding you want.

v forHeight: #avetemp
This should tell the visualizer that you want to visualize average temperatures as heightbars. Then, all the bars are shown by execution of show.

The data: method in class Visualizer tells the object which dictionary is wanted, and the instance variable bars is initialized. In forHeight: method, the bars are generated and added to bars.

Your Job

The code, as given, works. But there are flaws in it:

Make these two changes to the system. (Note: Labeling is easier than scaling. I'd go after that, first. If you don't get to both of them, I wouldn't sweat it.)

Turnin

Turnin your filedout Visualizer category (both Visualizer and Bar classes), using Minnow.

Please use CrLfFileStream.cs!.

You can Turnin your code by going to the turnin page for your appropriate section:

http://minnow.cc.gatech.edu/cs2390w98a -- (Section A)
http://minnow.cc.gatech.edu/cs2390w98b -- (Section B)
http://minnow.cc.gatech.edu/cs2390w98c -- (Section C)
http://minnow.cc.gatech.edu/cs2390w98d -- (Section D)
http://minnow.cc.gatech.edu/cs2390w98e -- (Section E)
http://minnow.cc.gatech.edu/cs2390w98f -- (Section F)

You will be prompted for a user name and password. Your user name is your name as it appears on the CS2390 Home page. Your password is your 9 digit social security or Student ID number WITHOUT DASHES!.

Click on the Turnin new project link. Select Lab 7 in the Assignment menu.

You will now paste the code into the text area of the turnin web page. Click on the Turnin button and you are done!


News Page | CS2390 Win'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 3/4/98; 11:06:50 AM