What’s New in Computer Science Education? A Report on the 2005 ACM/SIGCSE Meeting.

Slides:



Advertisements
Similar presentations
1 Early GUIs with Java As presented in Java: Complete Course in Programming and Problem Solving by Lambert and Osborne.
Advertisements

Unit 111 Java GUI Components and Events  Learning Outcomes oDistinguish between GUI components and containers. oIdentify and distinguish top-level containers.
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
Lecture 8. Review (Methods of Math class) int abs( int num ) double sqrt( double num ) double pow( double num, double power ) Method parametersData type.
GUI Tutorial Images. Useful Info – not on final exam.
1 Class 8. 2 Chapter Objectives Use Swing components to build the GUI for a Swing program Implement an ActionListener to handle events Add interface components.
Java Swing Joon Ho Cho. What is Java Swing? Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.
Lesson 35: Review of the Java GUI. The JFrame, Container and JButton.
Introduction to Java GUI Creating Graphical User Interfaces © copyright Bobby Hoggard / material may not be redistributed without permission.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Intro to Java 2 By Geb Thomas Based on the Java TutorialJava Tutorial.
Intro to GUIs (Graphical User Interfaces) Section 2.5Intro. to GUIs: a GUI Greeter Section 3.7Graphical/Internet Java: Einstein's Equation.
Java The Beginning. Why Java?  Currently, this is the language of the international AP course which runs Feb-Apr  FREE!  Platform-independent  Simple.
Lesson 27: Introduction to the Java GUI. // helloworldbutton.java import java.awt.*; import javax.swing.*; class HelloButton{ public static void main.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Introduction to GUI in Java 1. Graphical User Interface Java is equipped with many powerful,easy to use GUI component such as input and output dialog.
Java GUI CSCE 190 – Java Instructor: Joel Gompert Mon, July 26, 2004.
Lab 6: Shapes & Picture Extended Ellipse & Rectangle Classes Stand-Alone GUI Applications.
GUI programming Graphical user interface-based programming.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Introduction to Applets Course Lecture Slides 29 th July 2010.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
The Model-View Approach in Teaching Java Maria Litvin Phillips Academy, Andover, MA
Java Applets. Topics What is an applet? To convert GUI applications to Applets Hello World applet example!! Applets life cycle examples Invoking applets.
An Introduction to Software Development Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006.
GUI Chapter 10 Graphics context and objects Creating a window based application JFrame, JTextField, JButton Containers and Controls Graphics commands Layout.
1 Block1 – unit 2 (The Case study in Budd 5-6).  create a small application that uses the Abstract Windowing Toolkit (AWT)  Swing packages to simulate.
Intro to Applets August 19, 2008 Mrs. C. Furman. Java Applets vs. Java Applications Java Applet: a program that is intended for use on the web. Java Applet:
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
Applets Yong Choi School of Business CSU, Bakersfield.
 GUI – Graphic User Interface  Up to now in the programs we have written all output has been sent to the standard output device i.e.: the DOS console.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
1 GUI programming Graphical user interface-based programming Chapter G1 (pages )
1 Applets. 2 Design of Applets 3 Sun wrote Java to be executable within a hosting application browser The applications are applets. An applet is downloaded.
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
Outline Creating Objects The String Class The Random and Math Classes Formatting Output Enumerated Types Wrapper Classes Components and Containers Images.
Basics of GUI Programming Chapter 11 and Chapter 22.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
1.  At the end of this slide, student able to:  Applet & Advanced Graphic  Learn how the Web browser controls and executes the applet  Learn how to.
Lecture 261 CS110 Lecture 26 Thursday, May 6, 2004 This lecture not delivered from slides Announcements –final exam Thursday, May 20, 8:00 AM McCormack,
Lecture # 6 Graphical User Interface(GUI). Introduction A graphical user interface (GUI) presents a user- friendly mechanism for interacting with an application.
Simple Java Eric Roberts CS 106A January 11, 2016.
Simple Java Eric Roberts CS 106A January 11, 2010.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Lesson 28: More on the GUI button, frame and actions.
Errors, GUIs, and Patterns Dr. Doug Twitchell August 30, 2005.
Computer Science 209 Software Development Packages.
Five-Minute Review 1.What steps do we distinguish in solving a problem by computer? 2.What are essential properties of an algorithm? 3.What is a definition.
Programming – Lecture 15 Going Beyond the ACM Library.
Lecture 7:Introduction to JavaFX Michael Hsu CSULA.
Computer Science I Lab 1 ISMAIL ABUMUHFOUZ | CS 180.
CPCS 391 Computer Graphics Lab One. Computer Graphics Using Java What is Computer Graphics: Computer graphics are graphics created using computers and,
Import javax.swing.*; class Check { public static void main(String[] args) { JFrame frame = new JFrame("Check"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//DO_NOTHING_ON_CLOSE.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 7 ( Book Chapter 14) GUI and Event-Driven Programming.
Five-Minute Review What steps do we distinguish in solving a problem by computer? What are essential properties of an algorithm? What is a definition of.
Software Development Packages
Graphical user interface-based programming
Chapter 2—Programming by Example
Applets.
UNIT-5.
Java IO and Testing made simple
Advanced Programming in Java
Chapter 2—Programming by Example
Presentation transcript:

What’s New in Computer Science Education? A Report on the 2005 ACM/SIGCSE Meeting

ACM/SIGCSE Meeting Where: St. Louis When: February 23-26, 2005 Papers:

Major Themes Women in computing Image processing Writing game software Robotics Approaches to introductory programming

Women and Computing A panel on experiences at different colleges A session with four papers A keynote address by Maria Klawe, past president of the ACM and Dean of Engineering at Princeton

Image Processing In secondary school (Scion) For training teachers in Georgia (Georgia Tech) In CS1 (Swarthmore)

Writing Game Software Games and CS education A concentration within the CS curriculum

Robotics A session with four papers A workshop on LEGO Mindstorms

Introductory Programming Debate on objects early Rigor (algorithms)-first approach The use of environments, microworlds, and toolkits The ACM Java Task Force

Created in 2004 to study problems with teaching Java in intro courses Solicited toolkits as proposed solutions or learning aides Published a draft of a report on the problems and a tentative synthesis or distillation of solutions

Problems With Teaching Java High-level issues –Scale –Instability –Execution speed –Textbooks and environments

Problems With Teaching Java Language issues –public static void main(String[] args) –Exceptions –Separation of interface and implementation –Wrapper classes –Parameterized classes –Enumerated types –Coding preconditions –Iterator syntax

Problems With Teaching Java API issues –Simple input mechanism –Graphics model –GUI model –Event model

Solutions Packages for –console I/O –modal dialog I/O –graphics A program package for writing applications/applets using these three I/O styles

Console I/O The package acm.io includes an IOConsole class that supports input and output of basic data types It can be used with or without the acm.program package

import acm.io.*; import java.awt.*; import javax.swing.*; public class CircleArea{ public static void main(String[] args){ JFrame frame = new JFrame(); IOConsole console = new IOConsole(); frame.getContentPane().add("Center", console); frame.setSize(500, 300); frame.setVisible(true); console.println("This program displays the area of a circle"); int radius = console.readInt("Enter the radius: "); double area = radius * radius * Math.PI; console.println("The area is " + area); } Example with IOConsole

import acm.io.*; import java.awt.*; import javax.swing.*; public class CircleArea{ public static void main(String[] args){ IODialog dialog = new IODialog(); dialog.println("This program displays the area of a circle"); int radius = dialog.readInt("Enter the radius"); double area = radius * radius * Math.PI; dialog.println("The area is " + area); } Example with IODialog

Graphics The package acm.graphics includes –double-valued coordinates –A hierarchy of shapes that reflect the options available in the Graphics class but that maintain their state –A canvas that refreshes automatically

acm.graphics Hierarchy GCanvasGCanvasMenuBar GObject GTurtle GCompound GArc GPPen GDimensionGRectangle GImageGLabelGLineGOvalGRectGPolygon GPoint All GObject s accept mouse listeners

import acm.graphics.*; import java.awt.*; import javax.swing.*; public class HelloWorld extends JFrame { public HelloWorld(){ GCanvas gc = new GCanvas(); GLabel label = new GLabel("Hello world!"); label.setFont("Helvetica-bold-72"); label.setColor(Color.red); gc.add(label, 50, 100); getContentPane().add("Center", gc); setSize(500, 300); } public static void main(String[] args){ new HelloWorld().setVisible(true); } Example With Graphics

The Output

acm.program Package Encapsulates the main method so it’s not a distraction Can run a program as an application or an applet with no changes Backwards compatible with JDK 1.1 for older browsers Includes standard menus for printing an interaction and accepting input from files

acm.program Hierarchy Program ConsoleProgramDialogProgramGraphicsProgram java.applet.Applet

import acm.io.*; import java.awt.*; import javax.swing.*; public class CircleArea{ public static void main(String[] args){ JFrame frame = new JFrame(); IOConsole console = new IOConsole(); frame.getContentPane().add("Center", console); frame.setSize(500, 300); frame.setVisible(true); console.println("This program displays the area of a circle"); int radius = console.readInt("Enter the radius: "); double area = radius * radius * Math.PI; console.println("The area is " + area); } Example with IOConsole

import acm.program.*; public class CircleArea extends Program{ public static void main(String[] args){ new CircleArea().start(args); } public void run(){ println("This program displays the area of a circle"); int radius = readInt("Enter the radius: "); double area = radius * radius * Math.PI; println("The area is " + area); } Example with Program Uses the host system’s terminal

import acm.program.*; public class CircleArea extends Program{ public void run(){ println("This program displays the area of a circle"); int radius = readInt("Enter the radius: "); double area = radius * radius * Math.PI; println("The area is " + area); } Example with Program Omit main method to simplify

import acm.program.*; public class CircleArea extends ConsoleProgram{ public void run(){ println("This program displays the area of a circle"); int radius = readInt("Enter the radius: "); double area = radius * radius * Math.PI; println("The area is " + area); } Example with ConsoleProgram Extend ConsoleProgram to get a console window with File and Edit menus

import acm.program.*; public class CircleArea extends DialogProgram{ public void run(){ println("This program displays the area of a circle"); int radius = readInt("Enter the radius: "); double area = radius * radius * Math.PI; println("The area is " + area); } Example with DialogProgram Extend DialogProgram to get I/O with modal dialogs

import acm.program.*; public class CircleArea extends DialogProgram{ public void run(){ IOModel io = this.getConsole(); io.println("This program displays the area of a circle"); int radius = io.readInt("Enter the radius: "); double area = radius * radius * Math.PI; io.println("The area is " + area); } Make It More Oopy-Like Both IOConsole and IODialog implement IOModel

import acm.graphics.*; import java.awt.*; import javax.swing.*; public class HelloWorld extends JFrame{ public HelloWorld(){ GCanvas gc = new GCanvas(); GLabel label = new GLabel("Hello world!"); label.setFont("Helvetica-bold-72"); label.setColor(Color.red); gc.add(label, 50, 100); getContentPane().add("Center", gc); setSize(500, 300); } public static void main(String[] args){ new HelloWorld().setVisible(true); } Example With Graphics

import acm.graphics.*; import acm.program.*; public class HelloWorld extends GraphicsProgram{ public void run(){ GLabel label = new GLabel("Hello world!"); label.setFont("Helvetica-bold-72"); label.setColor(RED); double x = (getWidth() - label.getWidth()) / 2; double y = (getHeight() - label.getAscent()) / 2; add(label, x, y); } Example With GraphicsProgram

import acm.graphics.*; import acm.program.*; public class DrawTurtleFlower extends GraphicsProgram{ public void run(){ GTurtle turtle = new GTurtle(); add(turtle, getWidth() / 2, getHeight() / 2); turtle.penDown(); for (int i = 0; i < 36; i++){ for (int j = 0; j < 4; j++){ turtle.forward(100); turtle.left(90); } turtle.left(10); } Turtle Graphics Example Can be decomposed with methods or by subclassing

Ouput

GUI Programs? The task force could not agree on a common framework Recommends using a toolkit like BreezySwing But it would be nice to have a standard GUIProgram class