CS 106A Chapter Notes - Chapter 10: Init, Ableton
Document Summary
Intro: synchronous interaction = user input is synchronized with program operation a. i. Colsoleprogram stuff with readint : asynchronous = allow user to intercede at any point, event driven, events = mouse clicking, gui = graphical user interface d. i. Allows user to control program by manipulating interactive components on screen d. ii. Interactors = interactive components like buttons you can push: the java event model, mouseevent = action with mouse like moving or clicking a. i. Nee to know coordinates of mouse on screen a. ii. Interface = collection of methods that define particular behavior. Public class myprogram extends graphicsprogram implements mouselistener: simple event driven program, run program is not necessary, after program declares itself to be mouselistener, any subclass of program can act as c. mouse listener. Info stored inside mouseevent object e and can be retrieved by calling e. getx() and. Public void init() { addmouselisteners(); public void mouseclicked(mouseevent e) { Add(star, e. getx(), e. gety()): responding to mouse events, two types of interfaces a. i.