1 / 6

Processing == Java + Extra Utilities Processing Adds: Drawing functions

Processing == Java + Extra Utilities Processing Adds: Drawing functions Text and font manipulations Image and video 3D transformations Keyboard interaction An editor …. Best way to see what Processing becomes is to generate a Java program and compare File | Export

rodd
Download Presentation

Processing == Java + Extra Utilities Processing Adds: Drawing functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Processing == Java + Extra Utilities Processing Adds: • Drawing functions • Text and font manipulations • Image and video • 3D transformations • Keyboard interaction • An editor • …

  2. Best way to see what Processing becomes is to generate a Java program and compare • File | Export • Look in generated applet folder

  3. What's different? • Import of core Processing libraries • Import of numerous Java libraries • Encapsulation of code in subclass of PApplet • Explicit visibility – public, private … • Number format changes if (random(1.0) < 0.5) -> if (random(1.0f) < 0.5f) • color data types are converted to int • Some functions are changed numbers = int(snumbers); -> numbers = PApplet.parseInt(snumbers); • Added public static void main() {…

  4. The smallest program in Processing println("Hello World!"); All Java programs start with at the special function … public static void main() { … The equivalent program in Java. class HelloWorldApp { public static void main(String[] args) { // Display the string. System.out.println("Hello World!"); } } This must be added to the generated Java program

  5. PApplet • The top-level class in Processing • The class in which all your Processing code goes • Implements most of Processing's core behavior • Way down the Java hierarchy • java.lang.Object • ↘ java.awt.Component • ↘ java.awt.Container • ↘ java.awt.Panel • ↘ java.applet.Applet • ↘ processing.core.PApplet http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/processing/core/PApplet.html

  6. Nearly all of Java is available from Processing http://download.oracle.com/javase/6/docs/api/

More Related