Chapter 22 The Smooth Motion: Case Study in Algorithmic Solving.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
UNIT 12 LO4 BE ABLE TO CREATE WEBSITES Cambridge Technicals.
Events Part III The event object. Learning Objectives By the end of this lecture, you should be able to: – Learn to use the hover() function – Work with.
6 Developing Content and Layout Section 6.1 Generate and organize content ideas Write and organize Web text Section 6.2 Identify page dimension guidelines.
Web Site Development Test 2 Working in DreamWeaver.
Chapter 19 Programming Functions. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives Apply JavaScript rules.
Chapter 6 Photoshop and ImageReady: Part II The Web Warrior Guide to Web Design Technologies.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
TITLE SHOULD BE ALL CAPS AND AROUND 75 FONT Author’s names should be around 62 pt font Emporia State University, Department of [enter department name here]
Web-based Application Development Lecture 9 February 7, 2006 Anita Raja.
Chapter 20 Thinking Big: Functions. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Anatomy of a Function Functions are packages for.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Information Technology Center Hany Abdelwahab Computer Specialist.
Web Page Development Identify elements of a Web Page Start Notepad
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Macromedia Dreamweaver 4 Advanced Level Course. Add Rollovers Rollovers or mouseovers are possibly the most popular effects used in designing Web pages.
CHAPTER 11 Tables. How Are Tables Used Data Display  Very tidy and very useful Better Text Alignment  Putting text in tables allows you to format indents.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
Web Technologies Website Development Trade & Industrial Education
The Bean Counter: A JavaScript Program
Learning Objectives Use the Bean Counter application as a model to do the following: Write input elements Create a button table Write an event handler.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
Website Development with Dreamweaver
Announcements Assignment 9 is due Project 2 is due 7/27/04 We will be skipping chapter 22 Test 3 (chapters 18-21) will be on 7/29/04 Tip of the Day : Functions.
Chapter 12 FRAMES. HOW FRAMES WORK When you view a framed page in a browser, you are actually looking at several HTML documents at once. The key to making.
Advanced Project Plan Formatting Lesson 14. Skills Matrix SkillsMatrix Skill Customize the calendar view Format bar styles for tasks in the Calendar view.
1 Lesson 3 Power Techniques HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
MICROSOFT WORD 2007 INTERMEDIATE/ADVANCED. CREATE A NEW STYLE BASED ON A SELECTED TEXT HOME tab > STYLES group dialog launcher > at the bottom of the.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
CSCE 102 – Chapter 6 (Web Design and Layout) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
Chapter 5: Windows and Frames
Chapter 18 A JavaScript Program. Learning Objectives Use the Bean Counter application as a model to do the following: –Write input elements –Create a.
IT: Web Technologies: Web Animation 1 Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Designing Web Site Layout Using.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
HTML ( HYPER TEXT MARK UP LANGUAGE ). What is HTML HTML describes the content and format of web pages using tags. Ex. Title Tag: A title It’s the job.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Learning Objectives State and apply the Decomposition Principle
Who Wants to be a Millionaire? LIFELINES 1.50/50 2.Poll the audience 3.Ask Another Student.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
Tutorial 7 Creating Animations. XP Objectives Learn about animation Create a timeline Add AP divs and graphics to a timeline Move and resize animation.
Spiderman ©Marvel Comics Creating Web Pages (part 1)
Chapter 8 HTML Editors. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 8-2 Text Editors Text editors don't have word processing features.
What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup.
Positioning Objects with CSS and Tables
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
Microsoft Expression Web 3 Chapter 6 Adding Interactivity.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
Chapter 4 Frames and Cascading Style Sheets. Frames Frames divide a browser window into two or more separate pieces or panes, with each pane containing.
To create text styles click on Home >> Tab under Change Styles
MODULE SIX WORKING WITH CHARTS AND IMAGES Functional ICT.
Chapter 18 A JavaScript Program. Learning Objectives Use the Bean Counter application as a model to do the following: –Write input elements –Create a.
Fluency with Information Technology
Applying CSS to Tables Stylish Tables.
Programming the Web using XHTML and JavaScript
Exercise 39 - Skills A table on your Web page provides one of the best ways to organize and align graphics, text and other objects on the page. You can.
Tutorial 6 Creating Dynamic Pages
Information System Analysis
The Smooth Motion: Case Study in Algorithmic Solving
Presentation transcript:

Chapter 22 The Smooth Motion: Case Study in Algorithmic Solving

Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 22-2

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Planning Smooth Motion Apply the Decomposition Principle –Divide a large task into smaller subtasks that can be solved separately and then combine their solutions to produce the overall solution Principle can be applied again to each subtask, if necessary

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Planning Smooth Motion (cont'd) Carol Schwartz: Can we insert the table that appears as part of the text on page 637? Carol Schwartz: Can we insert the table that appears as part of the text on page 637?

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Planning Smooth Motion (cont'd) Decide on a Problem-Solving Strategy –Strategy on how to solve each part –Order in which we'll solve parts –Build a basic web page first Don't spend time embellishing page until other tasks are done

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Planning Smooth Motion (cont'd) Solve Independent Tasks before Dependent Tasks –Some tasks rely on other tasks –Independent tasks should be done first Tasks that depend on the independent tasks are done next, and so on PERT Chart –Task dependency graph

Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 22-7

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Build the Basic Web Page GUI Full GUI has table with heading, grid, keys, controls, instructions Basic structural page: –Table –Heading –Instructions –Background color, font style and color –Centering of application on page

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Build the Basic Web Page GUI (cont'd) The Structural Page –Five-row, one-column table –Text for the Smooth Motion heading and Instructions in first and last rows The Structural Page Heading – heading for heading, paragraph tag for instructions (set font color for instructions text)

Copyright © 2006 Pearson Addison-Wesley. All rights reserved

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid Recall three basic steps of animation: –Define and place initial image –Prefetch frames for updating image –Set timer and build timer event handler to update image

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Frames for the Columns of Blocks –Design and organize the column frames Indexing Columns from Left to Right –On each time step, given column is replaced by column to its right –If columns are indexed left to right, index in column i of grid at a given step is replaced on next time step by image in column i + 1 –The last column needs to have a new image assigned

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd)

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Second Analysis –Define and organize the eight columnar frames –Define and fetch the initial images (0-19) –Prefetch the eight frames for uploading the image –Set a timer with an event handler that shifts the images in columns 1 through 19 to columns 0 through 18, and assign new frame into column 19

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Subtask: Define and Organize the Frames –Guidelines for creating frame images Ensure all images overwriting one another have the same dimensions in pixels Ensure all frames are saved in.gif or.jpeg format, and that they are used consistently (only overwrite.gifs with.gifs)

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Subtask: Define and Place Initial Images –Use tag to place initial image on page –Use a loop to complete image initialization of 20 images

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Subtask: Prefetch the Frame Images –Declare the array into which the images will be fetched –Initialize the array elements to be image objects –Assign the names of the files to the src fields of the image objects, causing browser to record the names and get the files

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Animate the Grid (cont'd) Subtask: Set Timer and Build Timer Event Handler –Event handler animate() has three operations: To move all images but the first, one position to the left To assign a new frame to column 19 To schedule itself for sometime in the future

Copyright © 2006 Pearson Addison-Wesley. All rights reserved

Copyright © 2006 Pearson Addison-Wesley. All rights reserved

Copyright © 2006 Pearson Addison-Wesley. All rights reserved The Best Laid Plans… We find it cumbersome not to be able to start and stop animation on demand Build control task is scheduled for later Makes more sense to solve it now, to simplify our work

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Build Controls What should happen when the control is clicked? –Go button click-event Start animation with setTimeout(), keeping track of the handle –Stop button click-event End animation by clearing the timer using the handle –Radio button click-event Set the timer interval by assigning to duration Place this code in the fourth row of the structural page table

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Sense the Keys Ability to recognize when mouse hovers over a given key We need to learn about mouse motion detection –Browser with OS keeps track of where mouse is at any given time –MouseOver and MouseClick events recognized in JavaScript

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Sense the Keys (cont'd) Subtask: Define and Organize the Frames Subtask: Place the Initial Images –Placing the images creates the keys –Place seven images in center of third row of the structural table using a loop

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Sense the Keys (cont'd) Subtask: Prefetch the Frames –Analogous to earlier animations –Since there are only two frames to prefetch, it's not worth writing a loop

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Sense the Keys (cont'd) Subtask: Build the Event Handlers –here() for MouseOver –gone() for MouseOut –What should happen when mouse moves over a key Key must change color to give user feedback Must tell Grid Animation event handler which new Stack image to draw in the last position in the grid

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Sense the Keys (cont'd) Combine the Subtasks –Add the event handler specifications to the tags

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Staircase Detection Subtask: Recognizing the Staircase –How do we recognize the seven consecutive frame values? –Keep predicting the next frame value

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Staircase Detection (cont'd) Subtask: Recognizing Continuity –Modifiy the animate() function at the point where it is about to set the timer for the next tick If the staircase is found, there should be no next tick

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Assemble Overall Design Build Controls task was performed out of order Parts of Assemble Overall Design task performed ahead of time There is not much left to complete the programming Make sure the whole application runs as planned

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Primp the Design Make structural page more attractive –Table background color –Cell padding

Copyright © 2006 Pearson Addison-Wesley. All rights reserved Assessment and Retrospective Three primary topics from earlier chapters used in this design: –Loops –Parameterizing functions for reuse –Managing complexity with functions

Copyright © 2006 Pearson Addison-Wesley. All rights reserved

Copyright © 2006 Pearson Addison-Wesley. All rights reserved