| Don't worry about it for now. You don't need anything more complicated (or, in this case, more correct) than the square/line representation. If you want to go ahead and add northside drive in your own map, feel free. Shaggz |
| Like Shaggz said on the first question. (P.S., Please SIGN your questions!) For all questions of accuracy, just do this map. As you'll find on P7, you're going to dump it all anyway, so make it flexible. Yes, you are supposed to handle each possible street case on the specific map. How you create the relationship between map graphical coordinates and the logical street/intersection name is entirely up to you. I'm not going to lecture on it. I'm assuming that you can use Arrays, Dictionaries, OrderedCollections, and create your own objects as you need to in order to maintain the mapping. Finally, no, we're not going to test with invalid input, but it's a good idea to handle it. Mark Guzdial |
| Randy, I explained how to draw lines on Forms on Thursday. If you just download the GIF, you do have to figure out the coordinates yourself. If you draw the lines, you know all the coordinates. To get the coordinates, you might put the GIF on the display then use Sensor mousePoint to poll the mouse for it's location as you point at features of the map. Mark Guzdial |
| Should be posted in the next day or so. Mark Guzdial |
| As the user, I don't care. I just care that you make routes and other features work right. Mark Guzdial |
| You MUST work for the given street names. Yes, you might be able to get it to work "better." But your user wants it this way. Mark Guzdial |
| Question on data structures: |
| Like I said in class on Tuesday, Java Vectors are Squeak OrderedCollections. There is an appendix in the textbook with lots of examples of using various collections in Squeak. Mark Guzdial |
| I'm not sure if this is exactly what you're looking for, but maybe it'll help you out :) Try looking in the System Browser (you'll find it in that Tools tab) and check out the classes in the "Collections" categories. ellie |
| I haven't figured out how to rotate the text yet, but I've been trying to get the form the DisplayText object is drawing on when you use the message send asDisplayObject on a string. Then, you should be able to rotate the form the text is in. For some reason, though, I'm not able to rotate the text inside that form. It doesn't give me an error. The text just sits there and doesn't rotate. -Nathan Owens |
| check out the Pen class methods for drawing on a form. Then, check out the ImageMorph class. I think you'll find a method in there for how to set the form the ImageMorph uses. If you use the same form for the ImageMorph and what the Pen draws on, you should get it to come out right. I'd suggest using a SketchMorph, though. It's easier to draw on and use the same form as the Pen (at least for me) -Nathan Owens |
| What are you drawing on? Try drawing right on the Display. Red works for me there. Default forms are B/W. Mark Guzdial |
| Chase, what primitive failed? Did you try clicking on the Debug button and looking at the primitive and what parameters it was working on? Instructions on using the Debugger are in the book. Mark Guzdial |
dt := 'Hello World!' asDisplayText. dt foregroundColor: Color black backgroundColor: Color white. f := Form extent: 200@200. dt displayOn: f f display
| everything works means everything works but it doesn't sound very stylish: 20% Good Smalltalk style Webb |
| What's going on, Brett, is that you're drawing directly on the Display with the Pen. When the screen is redrawn, your "scribbles" are erased. The way around this is to draw into a Form, then put the Form into a SketchMorph or ImageMorph. Now, redraws won't affect you. Mark Guzdial |
| self beSticky Webb |
| Webb's right, but there's another answer: Use a coordinate system local to the GIF (e.g., take all coordinates as relative to the topLeft of the SketchMorh's boundingBox). Then you can handle wherever you get dragged to. Mark Guzdial |
| Pen's don't know how to draw on SketchMorphs. They know how to draw on Forms, including the Display. Mark Guzdial |
| this is the same with all morphs; self delete, or smack the halo. Webb |
| To "smack the halo," Alt-Click/Cmd-Click on the SketchMorph, then click the left-corner X halo. That'll delete it. Mark Guzdial |
| No, it won't be okay. Perhaps load from the Web? I think we're turning in projects – have it pre-loaded? Mark Guzdial |
| Try my above example, or the one in Thursday's lecture notes – it does work Mark Guzdial |
| Yup. Mark Guzdial |
| See previous answers. Mark Guzdial |
| Neither – put it in a method. Mark Guzdial |
dt := 'Hello World!' asDisplayText. dt foregroundColor: Color red backgroundColor: Color white. dt computeBoundingBox. f := Form extent: 100@16 depth: 16. dt displayOn: f. nf := f rotateBy: 30. nf display
openInWorld, it works fine. However, if I
openInWorldearlier, and then do my pen work on the SketchMorph's form, the pen work doesn't appear. (Even with
revealPenStrokes.) I'm pretty sure
openInWorlddoesn't make a copy of the SketchMorph...
| When you create the SketchMorph withForm:, the form is copied then. Drawing on the form after that won't show. Mark Guzdial |
| I was able to get a SketchMorph to redraw after the form was updated by calling fullReleaseCachedState on the morph. -D. Hilley |
form := HTTPSocket httpGif: 'http://coweb.cc.gatech.edu:8888/cs2340/uploads/1941/map.gif'. (SketchMorph withForm: form) openInWorld
newForm:and
form:just don't seem to be doing the job. If I can't change the form on the fly, then I can either wait until the end to display the map, which means "openInWorld" doesn't display it, or I can make another SketchMorph to display the map with the route drawn, which sounds inefficient. Perhaps related... anywhere I draw (including display) the lines are green. So I tried specifying my own (rgb and hsv), and nothing but white and black comes out right (as Chase Peeler said, red is (r:1 g:1 b:0). The form is a ColorForm, and its bit depth is 8. Michael L. Mitchell
| If Publishing takes too long, then you've got some really large objects that you have connected to Workspace variables. Try closing your workspaces and emptying the trash (the Trash is in the Squeak flap). Mark Guzdial |
| A few inconsistencies and misspellings have been noted - just go with what is on the gif even if Brittainy is not a street, etc. Keep in mind the user is going to want to say 'techwood' instead of 'Techwood Drive' eventually. eh? Webb |
| Like Webb says: Go with whatever the map says. Mark Guzdial |
| I think you're missing something about Alexander Powell's question. Doing the "reverse" or, what Alexander purported, meant forgetting about the distinction of ferst1, ferst2, so on. You are talking about further dividing the streets into blocks, which should not change the route tracing scheme if done correctly. However, these intersections may not make a good road object... Webb |
| First, EVERYBODY, PLEASE CREATE A WHO'S WHO PAGE AND SIGN YOUR NOTES WITH ASTERISKS, E.G. Mark Guzdial. It makes it easier to pick out individual postings and to figure out who people are. Second, "primitive failing" doesn't tell me much. USE THE DEBUGGER! What primitive? On what input? Mark Guzdial |
| I've said it on nearly every day in class so far, but I'll try again: YOU NEVER LOSE ANYTHING IN SQUEAK!! If you re-wrote it, you did work you didn't have to do. It's all in your .changes file, and it's all in plaintext. A bad sources file won't screw up your projects file. Mark Guzdial |
| Bad graphics board? Don't know. Mark Guzdial |
| Don't worry about it. If you can't read it, neither can we, and we won't be using it in testing. Mark Guzdial |
| Every object responds to the message "class" with its class. As I also said in class yesterday, it's a VERY bad idea to code by asking an object it's class. Mark Guzdial |
| File out your code (you saw me do it in class, and it's in the book). Print that. Mark Guzdial |
| That means that you have filed out a subclass, but not its superclass. So the class definition is missing and the class method methodsFor:stamp: is not understood. Mark Guzdial |
| I think it is asking if you want to file out the change ste along with the project...The answer to this question is a definate yes...When you edit within that project, all your changes (and new additions) get addred to the change set. So, esentialy, the change set cotains all your code...this should definately be included with the project! Lushi (an ex-TA) |
| Read the turnin directions, Ashish. It's absolutely critical if you want your code graded. Mark Guzdial |
| Donghan – You may be using a SketchMorph, then getting the form from it and creating a pen on that form. This is not the best way to do things, and the updates are slow. Instead of creating a pen and attaching it to the SketchMorph's form, use "penOnMyForm" to get the pen from a SketchMorph. Alexander Powell |
| Look in Chapter 6 – there's a way to get the World to update, though this sounds kind of suspicious. Mark Guzdial |
| Cristi, you just have to put asterisks around your name, *Cristi Jones* to get Cristi Jones. You don't have to create an anchor – CoWeb does that for you. Assume that the routes are well-formed – that's not the point of this exercise. (Of course, dealing with ill-formed routes is a sign of a good design.) Mark Guzdial |
openInWorldis stopping my program's execution (as in, none of my code after it is seems to be run, and any following
self haltwill not trigger a break. If I break before
openInWorldand step over it, the code continues as normal, but the Morph doesn't display. Since we need the map to display before we draw the line on it, I can't wait until the end to
openInWorld. Suggestions? Michael L. Mitchell
| Why do you need to display the SketchMorph? You can't draw on it. You can only draw on a Form. Draw on the Form, then open the Form in a SketchMorph at the end. Mark Guzdial |
openInWorlddisplay the map at that point (as the comment indicates), and then calling
showRoutedraw the line on top of that? If I only display the SketchMorph at the end, then I must wait for
showRouteto run first. Michael L. Mitchell
| Why are you using penOnMyForm? Why not create your own Form so that you're in control? Mark Guzdial |
| Sure. Something like either of those. Mark Guzdial |
| The names will be as they are on the map. If they're not readable for you, they're not readable for us, so we won't use those. I think I said both of these earlier. I also suggested putting your name in Who's Who and putting *'s around your name for reference. (This is my last check tonight – see you all in class tomorrow.) Mark Guzdial |
| This is of course not so handy now, it's Dalney. If you spend a fair amount of time lurking in the bushes outside the CRB, you'll probably notice the street sign sooner or later Shaggz |