PROCESSING & JAVA An Introduction to Computing. Objectives Be able to state and apply phases of development Be able to state and describe the goals of.

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning
Advertisements

Week 8 - Monday.  What did we talk about last time?  StdAudio.
Processing Lecture. 1 What is processing?
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
Creating an OOED Application
Copyright 2008 by Pearson Education Building Java Programs Graphics Reading: Supplement 3G.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
ObjectDraw and Objects Early Chris Nevison Barbara Wells.
Copyright 2008 by Pearson Education Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
First Bytes - LabVIEW. Today’s Session Introduction to LabVIEW Colors and computers Lab to create a color picker Lab to manipulate an image Visual ProgrammingImage.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
1 Graphical objects We will draw graphics in Java using 3 kinds of objects: DrawingPanel : A window on the screen. Not part of Java; provided by the authors.
Graphics Images – PictureBox control Drawing graphics - Graphics object Multimedia controls PictureBox control Image property – select image Choose how.
1 L07SoftwareDevelopmentMethod.pptCMSC 104, Version 8/06 Software Development Method Topics l Software Development Life Cycle Reading l Section 1.4 – 1.5.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
Coding: Games, Apps and the Arts Unit 0: Processing Basics 1.
Graphics and Multimedia Part #2
CHAPTER 1: INTRODUCTION TO COMPUTER SCIENCE Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
Image Synthesis Rabie A. Ramadan, PhD D Images.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
1 Chapter-01 Introduction to Software Engineering.
CSCE 121: Introduction to Program Design and Concepts Dr. J. Michael Moore Spring 2015 Set 12: A Display Model 1 Based on slides created by Bjarne.
CMSC 1041 Algorithms II Software Development Life-Cycle.
Introduction to Java Simple Graphics. Objects and Methods Recall that a method is an action which can be performed by an object. –The action takes place.
Chapter 2: Color and Applets Coming up: Introduction to Graphics.
Graphics. Graphic is the important media used to show the appearance of integrative media applications. According to DBP dictionary, graphics mean drawing.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Static Methods. 2 Objectives Look at how to build static (class) methods Study use of methods calling, parameters, returning values Contrast reference.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
© Calvin College, When we prepare a program, the experience can be just like composing poetry or music … My claim is that it is possible to write.
1 Building Java Programs Supplement 3G: Graphics These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They may not be rehosted, sold,
(C) 2010 Pearson Education, Inc. All rights reserved.  Class Graphics (from package java.awt) provides various methods for drawing text and shapes onto.
Introduction to Java Chapter 8 - Introduction to Java Graphics1 Chapter 8 Introduction to Java Graphics.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Often being different. Control flow By default Java (and therefore Processing) executes lines of a program one after the other –Doesn’t matter what happened.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 2 – Welcome Application Introduction to Graphical.
1 Introduction to Graphics b The last one or two sections of each chapter of the textbook focus on graphical issues b Most computer programs have graphical.
Resources & Bitmaps Adding clip art to your application.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Copyright 2008 by Pearson Education Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM D IGITAL S TILL I MAGES Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny Winter.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Intro to Graphics from Chapter 2 of Java Software Solutions
Introduction to Algorithms
Inserting and Working with Images
Building Java Programs
Week 8 - Monday CS 121.
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Basic Graphics Drawing Shapes 1.
What do these words mean to you?
Digital Media Dr. Jim Rowan ITEC 2110.
Chapter 1 Introduction(1.1)
Introduction to Algorithms
Building Java Programs
Building Java Programs
Building Java Programs
Graphics Reading: Supplement 3G
Presentation transcript:

PROCESSING & JAVA An Introduction to Computing

Objectives Be able to state and apply phases of development Be able to state and describe the goals of software engineering Be able to write valid Processing statements and documentation Be able to call a Processing method given an API

3 Iterative/Incremental Development Design Testing Implementation Analysis

4 Preliminary Analysis Always start by understanding and articulating the goals of the user experience you are trying to create. This requires that you: communicate with your stakeholders; produce a written articulation of the goal of the project.

5 Example: Analysis image from wikipedia.org We’d like to draw an official FITA archery target for use as a graphical icon. The icon should communicate a sense of shared purpose. A sample image is shown here.

6 Notes on Analysis Analysis answers “what” questions Good analysts know how to work with people and to think carefully about process. Written/drawn analyses are a good way to communicate with stakeholders. It’s often hard to anticipate everything here.

Preliminary Design When you understand the goals of the user experience, you plan out a solution. This requires that you: Specify data structures and algorithms; Identify the geometric elements of any sample images created during analysis.

8 Example: Design image from wikipedia.org The preliminary design creates an initial list of element descriptions. Elements: Ten evenly-spaced concentric rings with pairs colored white, black, cyan, red and yellow; A dot in the very middle.

9 Algorithm Specify your design using an algorithm. Think about what you want your algorithm to do so that you can test its output. Iteration 1 Algorithm: 1. Create a canvas 550x550 pixels. 2. Draw a single pixel at (275, 275). Intended output: a large sketch with a dot at the very center.

10 Notes on Design Design your data structures and algorithms before implementing them. Write them in as language-independent a way as possible. Be clear about the assumptions you make. Prioritize the elements of your design.

11 Implementation When you have a design, you can implement your first prototype as a Processing program. You don’t need to implement everything at once; start with the highest priority element of your design.

12 Processing IDE

13 Example: Implementation The highest priority elements of the design are the background and the “dot” in the center. Relevant implementation tools: The canvas; Pixels; Documentation; Built in processing methods ( size(), point() ).

14 Geometric Coordinate Systems

15 Pixels and Coordinates image from text chapter 2 size(150, 100); point(100, 50);

16 Statements Processing programs are implemented using sets of ordered statements. Statement Pattern: statement; where statement is a method call, assignment or block.

17 Calling Methods Many of Processing’s tools are implemented as methods that must be invoked or called. Method Call Pattern: methodName (argumentList) where: methodName is the pre-defined identifier of the method being called; argumentList is an ordered, comma- separated list of argument expressions.

18 Documentation Documentation explains the code using text ignored by the compiler Documentation Pattern: /* * Multi-line comments */ or //Single-line comment

19 /** * Target1 produces the dot at the middle of the FITA archery target. * (cf. * This routine assumes that 550x550 square canvas. * kvlinden, snelesen Fall, 2012 */ size(550, 550); // Draw the center point of the target. point(275, 275);

20 Notes on Implementation ● In this phase, focus on faithfully translating the data structures & algorithm into working code.

21 Testing When you have a working prototype, you can compare its behavior with your original user experience goals. Run the prototype; if appropriate, show it to your stakeholders.

22 Example: Testing

23 Notes on Testing This phase may motivate us to modify our design or even our analysis. Getting the code to compile and run is not the goal. The goal is to produce a program that is: Useful Correct Efficient Understandable User-friendly

Tool Box Ellipse Smooth Color Text Images

25 Drawing Ellipses image from text chapter 2 ellipse(50, 50, 65, 45); Pattern: ellipse(xCenter, yCenter, width, height)  xCenter – The x coordinate of the center of the ellipse  yCenter – The y coordinate of the center of the ellipse  width – The width of the ellipse’s bounding rectangle in pixels  height – The height of the rectangle in pixels

26 Smoothing image from text chapter 2 noSmooth(); ellipse(50, 50, 65, 45); smooth(); ellipse(50, 50, 65, 45);

27 Filling and Grayscale Color image from text chapter 2 size(200, 200); background(255); smooth(); fill(50); ellipse(100, 100, 150, 150); fill(150); ellipse(100, 100, 100, 100); fill(250); ellipse(100, 100, 50, 50);

28 RGB Color image from text chapter 2

29 Typesetting and Text image from text chapter 2 textFont(loadFont("CurlzMT-40.vlw")); fill(33, 33, 111); text("potus", 10, 65); Pattern: text(textString, xCoordinate, yCoordinate)  textString – The text to be typeset using the font loaded with loadFont(fontFilename) assuming that fontFilename was created using Processing’s font tool and stored in the data sub-directory  xCoordinate – The x coordinate of the lower-left corner of the text  yCoordinate – The y coordinate of the lower-left corner of the image

30 Bitmap Images image from wikipedia image(loadImage("potus-100x100.gif"), 0, 0); Pattern: image(imageObject, xCoordinate, yCoordinate)  imageObject – The image object to be rendered; this can be loaded with loadImage(imageFilename) assuming that imageFilename is stored in the data sub-directory  xCoordinate – The x coordinate of the upper-left corner of the image  yCoordinate – The y coordinate of the upper-left corner of the image

31 /** * Target1 produces a FITA archery target. * (cf. ) * This routine assumes that 550x550 square canvas. kvlinden, snelesen Fall, 2012 */ size(550, 550); smooth(); fill(255); ellipse(275, 275, 500, 500); ellipse(275, 275, 450, 450); fill(0); ellipse(275, 275, 400, 400); stroke(255); ellipse(275, 275, 350, 350); fill(0, 255, 255); stroke(0); ellipse(275, 275, 300, 300); ellipse(275, 275, 250, 250); fill(255, 0, 0); ellipse(275, 275, 200, 200); ellipse(275, 275, 150, 150); fill(255, 255, 0); ellipse(275, 275, 100, 100); image( loadImage("anImageFilename"), 250, 250); fill(0); textFont(loadFont("Calibri-40.vlw")); text("The imageName dartboard", 25, 60); textFont(loadFont("Calibri-Bold-40.vlw")); text(" official", 25, 60);