Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW2-Sp2005

Revisiting a collage (from CS1315), but this time in Java.

Got questions?


You only need to submit pictures with your PictureCollage.java IF you used pictures not in the MediaSources directory. You'll need to upload them along with PictureCollage.java. To resubmit (if you want to change something and submit again later), you'll first have to "retrieve" your assignment, and then reupload the files. Mark Guzdial


What path do we use for FileChooser.setMediaPath("???/") I know it should be where the pictures are located.

Right – wherever you have your MediaSources. REMOVEDnny will change that one line, put your pictures in his MediaSources directory, then compile and execute your program. And it should just work. Mark Guzdial


REMOVEDnny will "Run Document's Main Method" to execute the program right?
yes. Student24

In class on the 28th, could you run through the concept of "public static void main" and an example of how we would apply it and set up our class? Along with that, do we have to import java.awt., or something else?
http://coweb.cc.gatech.edu/cs1316/uploads/13/mypicture.java
Sure – I'm always happy to take questions! We've discussed public static void main in class and recitation, but I'm glad to take questions here or in class. There is some discussion of the main method on p. 69 in the course notes. My suggestion for HW2 is to download MyPicture.java or MyTurtlePicture.java from the Syllabus page and edit that to make your collage. Mark Guzdial


How do we know what to import before setting up our class? And what again does the import statement do? (ex: import java.awt.[asterisk];)
For Picture or Turtle, you don't need to import anything at all – it's already available if you set up your Preferences as we've discussed. You only need to do other imports for other facilities. You import java.awt.* if you want to access the Color class. If you want to access JMusic, there are three imports to do – copy them from any of the examples in the course notes or slides. Anything particular you want to ask about? Mark Guzdial



I'm trying to figure out the "(FileChooser.getMediaPath thing.
I have a question about that— If I'm using the butterfly.jpg picture, how will REMOVEDnny know or how will he be able to check access the picture?

nevermind– I got the getMedia Path thing! Sorry for the inconvienience!
Hope ya'll stay warm!- yt

Is an image manipulation a change in size or does need to involve color or something like that?

A change in size is valid, too. The collages that are currently on Gallery HW2: Picture collage-Sp05 are really cool, but I don't think that they actually meet the letter of what's required, yet. Mark Guzdial


Remember not to write the picture in the .java file you submit. I accidentally did that the first time I submitted.
MAJOR BUMMER!

Any particular reason why "Pixel[] pixels = this.getPixels();" gives me the error "cannot resolve symbol" in a public void. I have isolated it down to being a problem with "this" because it will work with an actual picture, et. Lucy.getPixels();. Thanks.
There is no this in a public static void main. this refers to the instance that got the method. That doesn't exist in a main() method. Mark Guzdial

everytime I try to call something like grayscale() or mirrorVertical() I always get the error "void cannot be dereferenced". For example:

passion.mirrorVertical().scale(0.5).compose(canvas,500,500);

Why is this?

nevermind, I think I figured out why "void cannot be dereferenced"
The answer is that mirrorVertical changes this – it doesn't return a new picture. You can only cascade methods like that if the methods return pictures. Mark Guzdial

if I use the same pic and pile it on itself, but crop...it doesn't look like a collage. it looks like 1 pic but with only parts of it manipulated...does that count as a collage?
If we can figure it out from the code, yes, it counts, but it'd probably be more fun if you tweak the colors as you pile it back up. Mark Guzdial

should we have comments in our .java files? if so, what do we need to include in them?
It's not required yet, but you should. It'll be required from HW3 on. Use the code that you're seeing in class as an example – comment sections of code to explain what you're doing, and comment whole methods to explain what they do. Including your name and gt-email address is always a wise/safe thing to do. Mark Guzdial


Is the HW deadline extended to Tuesday @ 10AM?



Link to this Page