Processing and Java David Meredith

Slides:



Advertisements
Similar presentations
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Scienze dellInformazione Università di Bologna.
Advertisements

OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
CS442- Advanced Programming with Java Prepared by: TA.Eman AlMoaili.
Libraries David Meredith Aalborg University.
UML Package Diagrams. package_name presentation view controller model.
David Meredith Minim David Meredith
1. Basics of R 2. Basic probability with R
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
T ESTING WITH J UNIT IN E CLIPSE Farzana Rahman. I NTRODUCTION The class that you will want to test is created first so that Eclipse will be able to find.
1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Java Integrated Development Environments: ECLIPSE Part1 Installation.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
Introduction to Android Studio
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Getting Started with Eclipse Sandeep Pasuparthy. What’s Eclipse? It is a free software / open source platform- independent software framework for delivering.
1 CSE 331 Java Packages; JAR Archives slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Processing Dr Andy Evans. Processing MIT Media Lab Libraries for visualisation. Wraps a simple visualisation scripting language.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
Android. The Eclipse IDE Installation Requirements: Eclipse Java Windows All must match (32-bit OR 64-bit) If you have a 64-bit OS & 32-bit browser,
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
ACM/JETT Workshop - August 4-5, Guidelines For Using BlueJ.
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
Object Oriented Programming … and other things you need to program in java.
POS 406 Java Technology And Beginning Java Code
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Android architecture & setting up. Android operating system comprises of different software components arranges in stack. Different components of android.
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Tutorial 1 Running JADE Under Eclipse Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct. 27, 2009.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
DEVS M&S Tutorial with eclipse IDE Chungman Seo
Installing Repast in the Eclipse IDE Charlie Gieseler 6/28/04.
Java Classes, Objects, and Events: A Preview JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Java Methods Methods contain a group of instructions that together perform a single task. For example if I want to perform the task of “making a pizza”,
Download and Install: 1.Java Development Kit (JDK) bin/INTERSHOP.enfinity/WFS/CDS- CDS_Developer-Site/en_US/- /USD/ViewProductDetail-Start?ProductRef=jdk-
INTRODUCTION TO MINECRAFT FORGE CSCI 3130 SUMMER 2014.
How to Install Eclipse Click hereClick here to download Eclipse.
Surya Bahadur Kathayat Outline  Ramses  Installing Ramses  Ramses Perspective (Views and Editors)  Importing/Exporting Example.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Building Packages BCIS 3680 Enterprise Programming.
Introduction to Eclipse Programming with an Integrated Development Environment.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
How to Execute first program in Borland C++. Install Borland C++ Download Borland C++ from LMS – rland%20C++%20V3.1.ziphttp://vulms.vu.edu.pk/Courses/CS609/Downloads/Bo.
Working with Packages BCIS 3680 Enterprise Programming.
CPSC 372 John D. McGregor Module 6 Session 4 Sonar.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Intro to the Atlas Platform Raja Bose Dr. Abdelsalam (Sumi) Helal January 23, 2007.
Java IDE Dwight Deugo Nesa Matic
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Python’s Modules Noah Black.
Obtaining the Required Tools
Setting up Eclipse Locally
JavaTeaching and Importing a github repository
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
CMPE212 – Reminders Assignment 2 due today, 7pm.
Presentation transcript:

Processing and Java David Meredith

Introduction Processing is based on Java When you run a Processing sketch, a Java program is created and run You can export a Processing sketch as – a Java applet – a Java application

Exporting as an applet Exporting a sketch as an applet creates a subfolder called “applet” in your sketch folder This applet folder contains a.jar file and a.java file The.jar file is an executable file – you can double- click on it to make it run The.java file is the Java source code for the program

The.java file The.java file contains the Java source code generated by Processing from your sketch This.java file is compiled by the Java compiler to give the executable.jar file

Importing libraries At the top of the.java file, we see all the java packages (libraries) that need to be imported in order for the program to be able to use all of Processing’s functionality The basic Processing functions are defined in processing.core The other libraries are mostly for creating and managing windows and interface events Many processing sketches actually don’t need to use all of these packages, so when you write your own Java code (as opposed to getting Processing to generate it for you), you probably won’t need to import all of these libraries Processing imports all the libraries the sketch might need when it generates the.java file

The class declaration line Every Java.java file contains one definition of a public class The name of the class must be the same as that of the file The class may be a subclass of at most one other Java class The class for a Processing sketch must extend PApplet This is because the sketch has been exported as an applet The class declaration line names the Java class and states that this class is a PApplet

The main method If you want to be able to run your Java class, then it must have a main method In order to run this sketch, we call the PApplet class’s “main” method The PApplet’s main method takes an array of Strings as its argument You can make a new array of Strings from scratch using new String[]{s1, s2,...} The second String in the array must the name of the class If you want the program to run in “present” mode, then make the first string “--present” You can also define the background colour as the first String in the array If class is to be runnable, must have a main method

The rest is the same as in the sketch! Variables, setup() and draw() are the same as in the Processing sketch itself

Export sketch to an application Choice which platforms you want to create executable files for Choose whether your want Full-screen “present” mode or not

Exporting to an application Creates three subfolders in the sketch folder, one for each operating system Each of these subfolders contains a double- clickable, executable file for the specified OS

Eclipse I recommend you use the Eclipse IDE for programming in Java You can download it by going to eclipse.org – Choose “Eclipse IDE for Java developers” and pick the version that’s right for your system

Code arranged into Projects. Each project contains an src folder which contains packages. Each package contains class definitions. Code arranged into Projects. Each project contains an src folder which contains packages. Each package contains class definitions. Should always have a package declaration at the beginning You may only have to import the processing.core package s line tells Processing to ignore certain types of warning Run butto n Needs to be fully qualified name of class

Tutorial on installing and running Eclipse There’s a tutorial on how to use Eclipse for processing here: – We’ll now work through this tutorial together and cover – Installing Eclipse and creating a new project – Importing the Processing libraries – Porting a Processing class to Java manually – Porting a Processing sketch with multiple classes as inner classes – Porting a Processing sketch with multiple classes as external classes