Labtest 05 - Preparation *CORRECTION*

Hi all, pls note that the Labtest 05 Package that was distributed has a problem. In the class PolkaDot, if the method is invoked to change the fill setting (true or false), the line that notifies the listeners was missing. Below is the corrected version.
-mb


public void setFilled(boolean isFilled) {
this.isFilled = isFilled;
dataModel.notifyModelHasChanged();
}

Labtest 05 - Preparation


-be familiar with workings of MVC as demonstrated in the lt05_pkg

-be able to use classes in the lt05_pkg to implement variants of the basic app, such as

-change way polka dots are drawn.  For instance: 
     -different stroke
     -filled/unfilled

-if user clicks on dot, change its appearance.  For instance:
     -change colour to black
     -increase size by 10%
     -decrease size by 10%
     -toggle between filled and unfilled

-if user clicks on point that does not have a dot already in that position
     -create a polka dot (e.g., with assigned or random colour; random position or upper left anchor position equivalent to the mouse click)
     -conditionally create a polka dot (depending on quadrant)
     -create a polka dot with conditional attributes (e.g., clicks in each of the form quadrants have different appearances) 

Labtest04

Topic of Labtest 04

this information was conveyed during lecture and is being provided here in written form.

  • Understanding how GUIs are launched (instantiation of JFrame on the Event Dispatching Thread)
  • Understanding how listeners work, installing listeners
  • Understanding how GUIs draw themselves (delegation to each component's drawComponent method)
  • Background material: the set of classes that support L15App1 and L15App2

Sample tasks
  • Modify GreenEllipsePanel so that it draws some other shape (scaled to its available dimensions; modify the statements within the paintComponent method)
  • Modify the body of a method in a listener class (at present, the bodies of all of the methods just print out event information); for instance, use the MouseEvent API to determine information about the mouse event, such as using methods to accesses information about the number of mouse clicks the user made or the x,y coordinate of the mouse trackpoint (both relative to the source component and in absolute terms, relative to the screen) and about when the mouse action was performed.
  • Given an app that is very similar to L15App2, modify the code so that the app's appearance is changed (add or remove JPanels to the root container)

Midterm Exam

Thursday, Feb 16, 10-11:30am
Location: CLH J
**Note - the midterm exam will NOT take place in our regular classroom location