HCI 252 - Screen Paint Lectures
also see Labs web site and overall lecture slides
- Extra notes:
-
- Monday 29th Oct
-
paint-and-events.pdf - how and wha screen painting
Tartan2007v0.java - start point just drawing a red square!
Tartan2007v1.java - added model and first view
NOTES: as well as seeing MVC and paint in action, other points I can recall ...
Copy and paste - whenever you do this think - if I have copies of the same code in two places should be abstracting this into a class or method?
Laying out the componets - creation of Swing coponens, putting on panel etc. - where does this belong? This is really a presentation issue, but a sort of higher level one to what goes in the single tartan component. In a more complex interface I might have put this in a class of its own. Here just separated into a method.
Previously I had put the code to attach the two commbo boxes to their listeners in this method, but in fact this is doing a different sort of job to the layout, so I separated this out into a special method for doing "linking" things.
- Tuesday 30th Oct
-
same as yesterday's slides - interaction between paint and user input + birthday surprise
Tartan2007v2.java - added controller ... but what is missing?
Notes:
Linking components. The combo boxe "know" what line thickness and colour should be, so how should we link these to the Tartan MVC? It is really just the Contriller that 'needs to know'. Actually this is a more general issue as they are each complete compoents in theo own right, so this is an issue about the linking toether of compoents again. As a fudge ... to put off the decision ... I temporarily just set them to be constant width and colour in the Controller class ... but obviously something has to happen. What do you think?
Hidden design decisions. Whilst coding I added the code in the Controller to the Mouse Release event ... but this was a design decision - almost 'accdentally' made durung coding. Is it the right one? Should things be drawn when the mouse goies down, up or is clicked fully within the compoent? Critical thing is I am not in the right 'role' while coding to be making this sort of UI desugn decision. How do we make sure we make decsiions at te right time? Alternatively can we have some way to record when we do this so that we can step back wut a 'UI design' hat on and review these implicit decisions? How do we prevent them just happening by accident without thought?