Computation as an Expressive Medium

Slides:



Advertisements
Similar presentations
POWERPOINT May 2004 To move the text box - move the mouse over the border of the text box, and once the 4-way arrow appears - click and drag the box to.
Advertisements

Week 8 Recap CSE 115 Spring Composite Revisited Once we create a composite object, it can itself refer to composites. Once we create a composite.
CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
Inheritance Inheritance Reserved word protected Reserved word super
These are the inheritance slides. They are slides just like all the other AP CS slides. But they are unique in that they all talk about inheritance.
CS 106 Introduction to Computer Science I 11 / 26 / 2007 Instructor: Michael Eckmann.
1 Lab-1 CSIT-121 Spring 2005 Lab Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming Exercise.
CS 106 Introduction to Computer Science I 04 / 16 / 2010 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 11 / 15 / 2006 Instructor: Michael Eckmann.
CPSC150 Interfaces Chapter CPSC150 Inheritance Review No different than any other class. Has no access to or information about subclasses class.
Using the Tax Assessor’s Database & Other land use datasets.
Event Handling. In this class we will cover: Keyboard Events Mouse Events Focus Events Action Interface Multicasting.
Abstract Classes and Interfaces
CS 106 Introduction to Computer Science I 04 / 13 / 2007 Friday the 13 th Instructor: Michael Eckmann.
Week 2 - Monday.  What did we talk about last time?  Software development  Lab 1.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Computation as an Expressive Medium Lab 12: Tools, Patterns, and Practices (and Collision Detection) Jason Alderman.
BIT 115: Introduction To Programming LECTURE 3 Instructor: Craig Duckett
QUEUES What are Queues? Creating a Queue Enqueuing and Dequeuing Testing for an Empty Queue.
CreatingSubclasses1 Barb Ericson Georgia Institute of Technology Dec 2009.
Coming up: Inheritance
CS1101 Group1 Discussion 6 Lek Hsiang Hui comp.nus.edu.sg
Georgia Institute of Technology More on Creating Classes part 3 Barb Ericson Georgia Institute of Technology Nov 2005.
Week 12 - Monday.  What did we talk about last time?  Defining classes  Class practice  Lab 11.
CS100Lecture 61 Announcements Homework P1 due on Thursday Homework P2 handed out.
In this lesson you will learn how to use character formatting to create professional looking documents. © 2014, John Wiley & Sons, Inc.Microsoft Official.
JavaScript: Conditionals contd.
1.4 Keyboard Training.
Week 2 - Wednesday CS 121.
Modern Programming Tools And Techniques-I
The purpose of this Action Research Project is to show how easily computers can be accessible to teachers and their students without impacting the instructional.
Setting Defaults in Microsoft Word for Accessibility
Basic Input and Output CSE 120 Spring 2017
GUI Programming using Java - Key Events
Creating an Account on Wikieducator
03/10/14 Inheritance-2.
Computation as an Expressive Medium
LCC 6310 Computation as an Expressive Medium
Week 14 - Monday CS 121.
Road Map Inheritance Class hierarchy Overriding methods Constructors
Adding Assignments and Learning Units to Your TSS Course
How I can save keystrokes?
Basic Input and Output CSE 120 Winter 2018
Object Oriented Programming (OOP) LAB # 8
Accent marks – how to.
A few tricks to take you beyond the basics of Microsoft Office 2010
An Introduction to Word Processing
Complex Conditionals Human languages are ambiguous
Introduction to C++ Programming
LESSON 14 - Building an App: Image Scroller
Headcount Information Sessions
Mess Wid Me! A Place for Every Photo and Every Photo in It’s Place!
Introduction To Microsoft PowerPoint 2007
More programming with "Processing"
Fundamentals of Data Representation
READY?.
Basic Input and Output CSE 120 Winter 2019
Inheritance and Polymorphism
An Example of Inheritance
Lecture 6 Methods and Classes
Review of Previous Lesson
Chapter 8 Inheritance Part 2.
Computation as an Expressive Medium
More on Creating Classes part 3
How to Become a PowerPoint Wizard
Lecture 6 Methods, Classes, Inheritance
Presentation transcript:

Computation as an Expressive Medium Lab 7: Subclasses and Text Capture Jason Alderman

Friday! Friday! FRIDAY! Subclass recap [super(); and super.___();] Text capture recap That's all for now… re•cap == re•ca•pi•tu•late, verb — to cover again, fr. Latin: re again, capit head, ulate ache horribly…of course.

Subclass Again, a subclass is like an ordinary class… …but it potentially has MORE: more fields (if you want to add fields) more methods (if you want to add methods) the same methods (with added functionality) the same methods (completely overwritten) How does it do this, you ask? HOW?

The subclass fields By default, the subclass (child) keeps all of the fields of the parent class… …you DON'T have to redeclare them. They're just there! Ready to use! Prêt-a-porter!! If you want to add more fields (variables), just declare them at the top, like you normally would.

The subclass constructor Three ways to do this: Write a whole new constructor, ignoring the constructor of the parent class Write a new constructor that does exactly what the parent class constructor does [using super();] Write a new constructor that does exactly what the parent class constructor does…and then more.

The subclass methods …work in much the same way as the constructor. New method not featured in parent class Overwrite old method with completely new code, ignoring the old code Extend the old method, using super.blah(); (Where blah is the name of the method in the parent class, of course.) and then adding further code Use the old one without changing a thing… UNLIKE the constructor, and LIKE the fields, you don't have to write a line of code, and the methods of the parent class are still there, ready to use!!

Keys. As you well know by now, when you type a key, its value is stored in a variable called (drumroll, please) key You can check the value of key anytime, …but this is generally a bad idea! (Like if you're checking the value of key whether a key has been pressed or not, every single time the screen refreshes…? BAD idea!) So, two ways, and two approaches…

In this corner… The two ways: The two approaches if(keyPressed){} in the draw() method void keyPressed() method The two approaches keyPressed will register if the key is pressed (pushed down) keyReleased will register if key has just been released (moves up after being pressed!) (Note: you CANNOT use keyReleased as a boolean…ONLY as a void keyReleased() method.)

What about CTRL, ESC, ALT…? Sometimes there's a key value for these: ESC is 27 …but SHIFT and ALT are both 65535 …and the arrow keys don't register at all! Non-character keys are CODED! if (key == CODED) { … } You have to use the variable keyCode instead of key, e.g., if (keyCode == SHIFT)

LOOKIT ME!!1!!! I'M A MICROSOFT CLIP ART! Recap of the recaps! LOOKIT ME!!1!!! I'M A MICROSOFT CLIP ART! w00t!! We've talked about subclasses (again!) We've talked about keyPressed (again!) Now…more time to work on the assignment If you're reading this after lab, I hope your HCI test went well (again!)