Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.

Slides:



Advertisements
Similar presentations
Processing and Java David Meredith
Advertisements

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.
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.
Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
How to Create a Java program CS115 Fall George Koutsogiannakis.
Java Tutorial – Building GUIs Java with Added Swing Daniel Bryant
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
26-Jun-15 Getting Ready for CIT Labs Lab is scheduled for 3;00-4:30 Fridays in Moore 207 Lab is not in Towne 309 (Registrar has it wrong) Everyone.
30-Jun-15 Getting Ready for CIT Labs Lab is scheduled for 1:30-3:00 Fridays in Moore 207 Lab is not in Towne 313 (Registrar has it wrong) Everyone.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lesson One: The Beginning
13-Jul-15 Getting Ready for Java. 2 What You Need 256 MB of RAM (512 MB or more recommended) 500 MHz Pentium or better Macintosh: must run Mac OS X, preferably.
Writing Methods. Create the method Methods, like functions, do something They contain the code that performs the job Methods have two parts.
GTECH 731 Lab Session 2 Lab 1 Review, Lab 2 Intro 9/6/10 Lab 1 Review Lab 2 Overview.
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Android 4: Creating Contents Kirk Scott 1. Outline 4.1 Planning Contents 4.2 GIMP and Free Sound Recorder 4.3 Using FlashCardMaker to Create an XML File.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
DUE Hello World on the Android Platform.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Presented By: Muhammad Tariq Software Engineer Android Training course.
POS 406 Java Technology And Beginning Java Code
IDEs Department of Information Systems and Computer Science Ateneo de Manila University.
CPSC1301 Computer Science 1 Overview of Dr. Java.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Copyright © Curt Hill Turtles The beginning of media computation.
Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java.
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
9/2/ CS171 -Math & Computer Science Department at Emory University.
Liferay Installation Prepared by: Do Xuan Hai 8 August 2011.
Java Coding Environment Installation & Execution guide 컴퓨터 프로그래밍 II Korea Univ.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Computer Science I Classes and objects Classwork/Homework: Examine and modify my examples. Make your own.
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
1 Class 1 Lecture Topic Concepts, Definitions and Examples.
Computer Science I Variables. Methods. Classwork/Homework: Re-do or do new drawing using variables & function(s). Zip folder and upload to Moodle dropbox.
CS2102: Lecture on Abstract Classes and Inheritance Kathi Fisler.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
Intoduction to Andriod studio Environment With a hello world program.
Time to apply stuff… Faculty of Mathematics and Physics Charles University in Prague 5 th October 2015 Workshop 1 – Java Wrestling.
Time to upload Virtual something.
Processing == Java + Extra Utilities Processing Adds: – Drawing functions – Text and font manipulations – Image and video – 3D transformations – Keyboard.
How to install JavaCV in Eclipse. Make sure to download and install all these before you proceed Eclipse for Java EE developers (current is Juno)
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Computation as an Expressive Medium Lab 9: Java Mode, External Code, and.JAR signing Jason Alderman.
Introduction to Android Programming
Eclipse.
ATS Application Programming: Java Programming
Computer Science I Variables. Methods.
Eclipse Navigation & Usage.
The Little Crab Scenario
Programming games Classes and objects (used for Jigsaw, Bouncing stuff, other projects) Homework: Complete cannonball. Video or Audio. Your own project.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Review of Previous Lesson
Java Coding Environment Installation & Execution guide
The beginning of media computation Followed by a demo
Presentation transcript:

Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over into IntelliJ

Recap We have been doing Java, but using the Processing Development Environment and accessing libraries

Preview: Layers of software (programs) Operating System: file system, input/output, etc. Processing Development Environment: includes invocation of setup, periodic invocation of draw, when event happens, invocation of mousePressed, etc. Setting of width, mouseX, etc. Your program: your setup, draw, etc. Your functions, your variables, your classes, etc. Java

Preview: Layers of software (programs) Operating System: file system, input/output, etc. IntelliJ: Integrated Development Environment Processing Libraries included Your program: your setup, draw, etc. Your functions, your variables, your classes, etc. Java code will be visible. Java

Behind the scenes The Processing folks wrote Java code that Invoked setup Invoked draw repeated according to the framerate Invoked mousePressed, etc. as necessary The PDE also has its way of adding image files.

JetBrain IntelliJ IDEA Many claim: it is the most Intelligent Java IDE (Integrated Development Environment) – Integrates editing, compiling, building (combining parts), running, debugging Includes code completion Helps with missing curly brackets Can specify styles of coding – Note: latest Processing does have more debugging, editing features than previous. Free for students and faculty Available for OS X, Windows, Linux:

Now Demonstrate JetBrains IntelliJ You use it at least today. Note: for next assignment, Virtual Something, spend some time on planning independent of implementationS! Note: Math/CS majors will need to do this in CS2, so it is good to start now.

IntelliJ IDEA on your computer Download and install the Java Development Kit (JDK 8) from /downloads/index.html /downloads/index.html Download and install the Ultimate Edition of the Jetbrains IntelliJ – IDE from Apply for a free full license using your Purchase address.

IntelliJ IDEA Tutorials ideaquick-start- guide.html ideaquick-start- guide.html on/ on/

Configuring IDEA Getting comfy in IDEA IDE: fy_in_idea_ide fy_in_idea_ide Just specify Project SDK (Standard Development Kit, normally use 1.8)

Note There are ways to set up Keyboard Shortcuts (go to Preferences) Specify Code Style (under Editor) Quickly rename identifier (e.g. variable name), called Refactor Right click on identifier and go to its declaration You can explore this later.

Running Processing Project in IDEA Download and unzip the processingIdea.zip file from Moodle (this is from previous CS1 class) Open IntelliJ Idea, click Open Navigate to the processingIdea folder (the results of unzipping). You are ready – Need to add some standard boilerplace – Copy over existing sketch or start to write Processing Make a small number of modification – If you forget, IDEA will remind you.

Find folder

Java terminology Project – Package Java Classes – data folder Jars – core.jar (Processing libraries) … External libraries

Another way to say it A project is usually a collection of packages A package is a group of related classes Packages help to organize your code Libraries are collections of "helper" code you can use in your program. They usually have a.jar extension the data folder, as in Processing, contains your resources (images, fonts, etc.) – Use standard copy and paste to get files into the data folder – Notice all your classes will have access to the data folder. You will not have to repeat Add file… when re-using an image, font, etc.

Screen shot my computer over the break

To add a New Package Just right-click on the project folder, select new==> package. The IDEA will create an empty package folder. You don't have to do this for your initial work.

To add a New Java Class (this is how you will create a new program) To add a new Java class, right-click on the Package name, select new  Java class

… give class a name Convention is to start with capital letter

Now, need to add [some] Java code Recall subclasses, your new class, say it is called MyClass, will extend Papplet. IDEA tells us that we need to import a library.

Adding Library (-ies) You can respond to what IntelliJ says and add import processing.core.PApplet; Later, when you try to run, you may get an error and another suggest. For example, I needed to add import processing.core.Pimage; OR you can add an import statement with a wildcard: import processing.core.*;

Need some more code: package CourseWorkCS1; import processing.core.*; /** * Created by jeaninemeyer on 12/21/15. */ public class BouncingThings extends PApplet { public static void main(String args[]) { String[] appletArgs = new String[]{"CourseWorkCS1.BouncingThings"}; if (args != null) { PApplet.main(concat(appletArgs,args)); } else { PApplet.main(appletArgs); } } … }

Add your Processing sketch Need to make these additions – Add public before setup, draw, mousePressed, etc. as well as any new class definitions. – Change any float constants.75 to.75f – If you declared something of datatype color color cl = color(255,0,0); change to int cl = color(255,0,0); Make sure this is all within the { } for the public class MyClass extends PApplet

So… My code defines the setup and draw methods for BouncingThings, the subclass that extends PApplet.

Run

To stop Click the stop button on the left side of the console

Classwork/homework IntelliJ IDEA is set up on these computers. Do download the processingIdea file and go through the steps to run an existing Processing sketch – Remember to add public to setup, draw, other Processing methods.

Preview Two assignments over the break Find article on computing in the news. Post a summary and your comments. Plan your virtual something. Will describe next class.