introduction to java
play

Introduction to Java February 27, 2008 1 What is Alice? A - PowerPoint PPT Presentation

Introduction to Java February 27, 2008 1 What is Alice? A programming environment 2 Tuesday, October 7, 2008 What is Alice? A programming language 3 What is Alice? A library of graphic objects 4 Tuesday, October 7, 2008 What is Alice?


  1. Introduction to Java February 27, 2008 1 What is Alice? A programming environment 2 Tuesday, October 7, 2008

  2. What is Alice? A programming language 3 What is Alice? A library of graphic objects 4 Tuesday, October 7, 2008

  3. What is Alice? A tool that runs animations 5 What about Java? A programming environment - BlueJ 6 Tuesday, October 7, 2008

  4. What about Java? A programming language 7 What about Java? A huge library (but less visual) 2D Graphical shapes - circles, lines, ... User interface elements - buttons, sliders, ... Networking Image manipulation... Many, many things 8 Tuesday, October 7, 2008

  5. What about Java? A tool for running a wide range of applications 9 Objects in Alice in Java 10 Tuesday, October 7, 2008

  6. Classes in Alice in Java 11 Methods in Alice 12 Tuesday, October 7, 2008

  7. Methods in Java 13 Types in Alice in Java Number int double Boolean boolean Object Penguin Location Train ... 14 Tuesday, October 7, 2008

  8. Event Handling in Alice in Java 15 Creating Objects in Alice in Java 16 Tuesday, October 7, 2008

  9. Anatomy of a Java Class public class FallBreak extends FrameWindowController { public void onMousePress (Location point) Parameter { Instruction new Text ("Fall break is coming!", 40, 100, canvas); } Method public void onMouseRelease (Location point) { canvas.clear(); } } Class 17 Coordinate System Coordinates measure pixels, the smallest dot of color a display can make Cartesian coordinates Display coordinates 100 (0,0) 100 -100 (0,0) 100 100 -100 18 Tuesday, October 7, 2008

  10. Methods & Constructors public class FallBreak extends FrameWindowController { Constructor call public void onMousePress (Location point) { new Text ("Fall break is coming!", 40, 100, canvas); } public void onMouseRelease (Location point) { Method call canvas.clear(); } } 19 Event Handling in Alice Need to tell Alice, which method to call when an event occurs An event can be for any mouse click or only when the mouse clicks on a specific object 20 Tuesday, October 7, 2008

  11. Event Handling public class FallBreak extends FrameWindowController { public void onMousePress (Location point) { new Text ("Fall break is coming!", 40, 100, canvas); } public void onMouseRelease (Location point) { canvas.clear(); } } 21 Summary Many similarities in programming concepts Alice - limited to creating animations Java - wide applicability Alice programming environment - menu, drag&drop eliminates syntax errors, but clumsy Java programming environment - less clumsy, but requires learning syntax 22 Tuesday, October 7, 2008

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend