Fall 2008ACS-1805 Ron McFadyen1 Event-driven programming Chapter 5 covers event-driven programming. Events are user or condition driven and so each event.

Slides:



Advertisements
Similar presentations
PIIT Computer Science Summer Camp - Alice July 11, 2012 Brenda Parker Computer Science Department MTSU.
Advertisements

Alice Inheritance and Event Handling. Inheritance Concept Consider this hierarchy; parents describe properties of children Animals Vertebrates MammalsFish.
Events Chapter 7. Interactive Real world is interactive User determines order of actions instead of programmer.
Alice in Action with Java Chapter 6 Events. Alice in Action with Java2 Objectives Create new events in Alice Create handler methods for Alice events Use.
Fall 2007ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
Fall 2009ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
Fall 2009ACS-1805 Ron McFadyen1 Functions A function is a collection of statement, similar to a method, but a function is defined to return a value to.
Fall 2009ACS-3913 Ron McFadyen1 Decorator Pattern The Decorator pattern allows us to enclose an object inside another object. The enclosing object is called.
Fall 2008ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice 2.0 Ron McFadyen Course OutlineMcFadyenOutline.
1 Fall 2007ACS Fall 2007 Text: Starting out with java from control structures through data structures Gaddis & Muganda Instructor: Ron McFadyen.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
Fall 2007ACS-1805 Ron McFadyen1 Functions and if-else A function is a collection of statement, similar to a method, but a function is defined to return.
Fall 2008ACS-1805 Ron McFadyen1 Ch 8 Recursion Recursion occurs when a method (or function) calls itself.
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
Fall 2007ACS-1805 Ron McFadyen1 Boolean functions & expressions A boolean function is one that returns true or false The guidelines for class-level methods.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 7 Repetition.
Fall 2007ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
Fall 2009ACS Ron McFadyen1 The context maintains an instance of a concrete state subclass State Pattern Each subclass (concrete state) implements.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 3 Programming - Putting Together the Pieces.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 8 Recursion.
Spring 2010ACS-3913 Ron McFadyen1 Command The command pattern encapsulates a request or unit of work into an object. An invoker will ask a concrete command.
Fall 2009ACS-1805 Ron McFadyen1 ACS-1805 Introduction to Programming using Alice.
Winter 2007ACS-3913 Ron McFadyen1 Observer Pattern Problem: There are many objects (observers / subscribers) needing to know of the state changes, or events,
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Fall 2007ACS-1805 Ron McFadyen1 Ch 9 Lists In some animations, several objects must perform the same actions Example: A marching band, where the band members.
CS320n –Visual Programming Interactive Programs Mike Scott (Slides 5-1)
Fall 2007ACS-1805 Ron McFadyen1 Chapter 4 OO Programming Concepts.
Interaction: Events and Event Handling
Fall 2007ACS-1805 Ron McFadyen1 Chapter 6 Functions & If/Else.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 3 Programming.
Event-driven programming. Most modern computer programs that people use have Graphical User Interfaces (GUIs). A GUI has icons on the computer screen.
Execution Control with If/Else and Boolean Functions
CompSci 4 Chap 5 Sec 1 Oct 13, 2005 Prof. Susan Rodger Note: thanks to Wanda Dann and Steve Cooper for slide ideas.
Alice: Functions Alice Chapter 6 September 19, 2005.
Interaction: Events and Event Handling
Alice in Action with Java Chapter 6 Events. Alice in Action with Java2 Objectives Create new events in Alice Create handler methods for Alice events Use.
Event Driven Programming Chapter 5. Sequential Programming Computer-Centric Computer-Centric Program Runs as Programmer Intended Program Runs as Programmer.
Events (2) (Alice In Action, Ch 6) Slides Credit: Joel Adams, Alice in Action CS 120 Lecture September 2012.
Today’s Agenda 1.Collect Pre-Lab 5 2.Collect Alice project storyboards 3.Events 4.Dummy Objects 5.Assign pair programming teams and meet upstairs for Lab.
Interactive Programming Sec 49 Web Design. Objectives The student will: Understand the difference between movie mode and an interactive program Understand.
CS350 – Windows Programming Formerly and more properly named: Event Driven Programming Dr. Randy Ribler.
Introduction to Windows Programming
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Interactive Programming Alice. Control of flow Control of flow -- how the sequence of actions in a program is controlled. What action happens first, what.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Fall 2009ACS-1805 Ron McFadyen1 Chapter 2 Program Design & Implementation.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 2 Creating Your First Animation (An Introduction to Programming)
Interactive Programming Alice. Control of flow Control of flow -- how the sequence of actions in a program is controlled. What action happens first, what.
5 Event Handling Interactive Programming Suggested Reading Interaction: Events and Event Handling, Supplemental Text for CPSC 203 Distributed this term.
Interactive Programming MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum redesign project.
CompSci 4 Chap 5 Sec 1 and 2 Oct 14, 2010 Prof. Susan Rodger.
CS320n –Visual Programming Execution Control with If / Else and Boolean Functions (Slides 6-2-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for.
Windows 7 Ultimate
Starting Out with Alice: A Visual Introduction to Programming
Event-driven programming
Use Case Analysis Chapter 5.
The Alice Interface.
Event Driven Programming
Interactive Programming
Alice terms Chapter 3.
Graphical User Interfaces in Java Event-driven programming
ICT Programming Lesson 5:
Instructor: Ron McFadyen 3D
Chapter 13: Handling Events
Ch 9 Lists In some animations, several objects must perform the same actions Example: A marching band, where the band members are performing the same.
Event-driven programming
Interactive Programming
Presentation transcript:

Fall 2008ACS-1805 Ron McFadyen1 Event-driven programming Chapter 5 covers event-driven programming. Events are user or condition driven and so each event defines a triggering event and an event-handler (a method)

Fall 2008ACS-1805 Ron McFadyen2 Event-driven programming Event trigger: spacebar pressed Response: Roll biplane Documenting events in storyboards e.g. Flight simulator program in Chapter 5 Event trigger: up arrow pressed Response: Move biplane forward Alice programming: a method is executed when event occurs

Fall 2008ACS-1805 Ron McFadyen3 Event-driven programming Think of the Alice system having a loop where it continually checks for the occurrence of an event. When an event occurs the Alice system invokes the event- handler defined for the event.

Fall 2008ACS-1805 Ron McFadyen4 Event-driven programming With Alice we can define events in the upper right window:

Fall 2008ACS-1805 Ron McFadyen5 Event-driven programming Next we’ll examine the examples of the text: Air-show flight simulator Saving people Greek tragedy