Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Working with images and scenes CS 5010 Program Design Paradigms “Bootcamp” Lesson 2.5 TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
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.
CSC1401 Drawing in Java - 2. Reminder from last class How do you save your modified picture? String filename = …; Picture stevePicture = new Picture(filename);
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Three types, subtypes, and inheritance. The story up until now Everything in your computer is data Including programs Data is divided into objects Objects.
GUI and Swing, part 2 The illustrated edition. Scroll bars As we have previously seen, a JTextArea has a fixed size, but the amount of text that can be.
Thirteen recursion. Recursion ► [define horizontal-array [object spacing count → [if [= count 1] object [group object [translate [point spacing 0] [horizontal-array.
Six compound procedures and higher-order procedures.
1 A Simple Applet. 2 Applets and applications An application is an “ordinary” program Examples: Notepad, MS Word, Firefox, Halo, etc. An applet is a Java.
Copyright 2008 by Pearson Education Building Java Programs Graphics Reading: Supplement 3G.
Twenty high-level operations on pictures. Recap: vector graphics constructors [box width height] Creates a picture with a box [group pictures …] Makes.
Three exquisite corpse: form and content. Parts of speech Nouns (from latin nomen, “name”) A word for a person, place, thing, or action, or a class of.
Fifteen high-level operations on pictures. Recap: vector graphics constructors [box width height] Creates a picture with a box [group pictures …] Makes.
Seven constructing simple procedures using abstraction.
Copyright 2008 by Pearson Education Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2.
A Simple Applet. Applets and applications An applet is a Java program that runs on a web page –Applets can be run from: Internet Explorer Netscape Navigator.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
A Simple Applet.
Six compound procedures and higher-order procedures.
2.4: Rotations.
1 Interface Types & Polymorphism & introduction to graphics programming in Java.
ITP 104.  While you can do things like this:  Better to use styles instead:
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
Graphics and Procedures Programming Right from the Start with Visual Basic.NET 1/e 5.
> 1 Diagrams in Word Faculty of Health Alan Grace.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Georgia Institute of Technology Barb Ericson Georgia Institute of Technology May 2006 Teaching Java using Turtles part 2.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 2 Graphics Programming with C++ and the Dark GDK Library Starting.
Sketching & Drawing Projects
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Tkinter Canvas.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
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.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
UNIT 4: AutoCAD Drawing Commands Objectives: Be able to identify, describe and/or apply… AutoCAD tools (Line, polyline, arcs, circles, rectangles, hatch.
CS 115 Lecture 6 Graphics Taken from notes by Dr. Neil Moore.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
Pixels, Colors and Shapes
high-level operations on pictures
constructing simple procedures using abstraction
CSc 110, Spring 2017 Lecture 6: Parameters (cont.) and Graphics
Word Lesson 6 Working with Graphics
ISC440: Web Programming II Ch14: HTML5 Canvas
Building Java Programs
Digital Media Dr. Jim Rowan ITEC 2110.
SSEA Computer Science: Track A
A movement of a figure in a plane.
Teaching Java using Turtles part 2
Building Java Programs
Building Java Programs
Building Java Programs
Building Java Programs
Graphics Reading: Supplement 3G
Working with images and scenes
Presentation transcript:

four simple expressions in meta

Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures (images) Points (positions within an image) Procedures (programs) Take a set of objects as inputs (arguments) Return another object as a result Procedures are the most important kind of data in computer science

Referring expressions in English Phrases that refer to an object or objects “Robin” “Rob” “The TA of this class” “the grad students of Ian” “the people in 324” “France” “capitalism” “The sum of 2 and 3” “The mother of the TA of this class” We’ll focus on two kinds Names (“Robin”, “Rob”, “France”, “capitalism”) Functional expressions (the X of Y)

A deeply nested referring expression “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation of [the mother of [the TA of [this class]]]]]]]] Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation of [the mother of [the TA of [this class]]]]]]]] Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation of [the mother of [the TA of [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation of [the mother of [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation of [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father of [the nation ofThe United States [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather of [the father ofGeorge Washington [the nation ofThe United States [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother of [the grandfather ofGeorge’s grandpa [the father ofGeorge Washington [the nation ofThe United States [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother of [the mother ofGeorge’s great grandma [the grandfather ofGeorge’s grandpa [the father ofGeorge Washington [the nation ofThe United States [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395 Please forgive the sexist expression “father of the nation”

Meaning follows form “The mother of the mother of the grandfather of the father of the nation of the mother of the TA of this class” [the mother ofGeorge’s great great grandma [the mother ofGeorge’s great grandma [the grandfather ofGeorge’s grandpa [the father ofGeorge Washington [the nation ofThe United States [the mother ofRobin’s mom [the TA ofRobin [this class]]]]]]]]cs 395

Referring expressions in meta Names (‘robin’, ‘rob’, ‘+’, ‘point’) Aka “variables” Refer directly to objects Constants (fixed names) Numbers Refer to fixed objects (the numbers) Strings “Arbitrary text enclosed in double-quotes” Also refer to fixed objects (the text) Functional expressions Sequences of expressions Separated by spaces (or line breaks) Enclosed in square brackets First expression has to refer to a procedure Example: [point ]

Some functional expressions [box width height] A picture of a box with the specified width and height (which must be numbers) [ellipse width height] Same, but gives you a curved object instead of a box [line point point] A line with the specified endpoints [point number number] A point with the specified coordinates

Rectangles [box width height] Creates a rectangle Centered at (0,0) Width is width Height is height Default coloring Unfilled (interior is left alone) Border drawn in black (which shows up very poorly in these slides) ► [box ] ►

hey stupid don’t you think it’s time you did an example?

Circles and ellipses [ellipse width height] Same, but curved If width and height are the same, you get a circle Otherwise, an ellipse ► [ellipse ] ► [ellipse ]

Lines [line start end] Makes a line from start to end Start and end are point objects Created using [point x y] Note that: Default is black line 1 pixel wide ► [line [point 0 0] [point ]] ►

Coordinate system Positions on the screen described by (x, y) coordinates X: number of pixels to the right of the “origin” Y: number of pixels down from the “origin” Coordinates can be negative (system just shifts the image to make them visible) (0,0) (100, 33) (33, 100)

Groups [group object object …] Make a composite picture from multiple picture objects Objects can be shapes or other groups ► [group [box ] [box ] [box ] [ellipse ]] ►

hey how about another example?

Translate [translate point object object …] Shifts objects so that their (0,0) is now at point Shifting by [point 10 20] moves everything Right 10 pixels Down 20 pixels Also acts like a group, so you can include multiple objects and they’re all shifted ► [group [box ] [translate [point 50 0] [box ]]] ►

hey show them how to handle errors

that’s everything you need to know for the assignment but here’s some other stuff you might have fun with

Scaling [scale scale-factor object object …] Make a composite object from multiple picture objects Also acts like a group, so you can include multiple objects and they’re all scaled ► [box ] ► [scale 2 [box ] [box 10 10]] ►

Rotate [rotate angle object object …] Rotates contents clockwise angle degrees about the point (0,0) Also acts like a group, so you can include multiple objects and they’re all rotated around (0,0) ► [rotate 45 [box ]] ►

Paint [paint color objects …] Fills interiors of objects with color, which can be A color object made with [color red green blue] A string (magic color name) A symbol (magic color name) The word: null (no quotes) Turns off filling Also acts like a group, so you can include multiple objects ► [group [box ] [paint “black” [box ]]] ►

Ink [ink pen objects …] [pen color width] Draws the outline of objects with specified pen Pen specifies color and width of line Pen objects can be created with the pen procedure … or you can just specify a color in lieu of a pen Also acts like a group, so you can include multiple objects ► [group [box ] [ink [pen “black” 10] [box ]]] ►

Peeking inside the data Objects are like web pages Pages can contain links to other pages Different from containing the pages themselves But I can in some sense pass you a whole set of pages by passing you a link to a single page that has links to the others Forming a group is like making a new web page with links to the component objects You can think of the components as “in” the group Or just as “available to” the group group ellipsebox

Data as hierarchy When we group objects inside groups inside other groups We get a tree- structured hierarchy Kind of like outlines And kind of like code group translatebox group translatebox group translatebox note: translate doesn’t actually change its arguments – it makes a translate object