EE495K Slides by Avi Kak: OO for GUI Design (contd.)

Size: px
Start display at page:

Download "EE495K Slides by Avi Kak: OO for GUI Design (contd.)"

Transcription

1 EE495K Slides by Avi Kak: OO for GUI Design (contd.) 1

2 Date: Tue, 18 Feb :42:33 CST To: From: Newton Matthew-W18732 Subject: RE: Visit to Purdue! Return-Path: Prof. Kak, Great to hear back from you too! We have several JAVA teams and our global standard in 2003 is to use a Linux OS with JAVA on all cell phones to take advantage of open source! Its amazing how much UML is also used (I did not expect). There is a lot of discussion on use-cases and object modeling before any code is written! Matt Newton Systems Developer PCS Engineering Quality Motorola, Inc. Phone: Pager (2-way): or @skytel.com matt.newton@motorola.com 2

3 1. What are the four different categories of classes in the Java AWT/Swing packages? Also, what s the purpose of each category? 3

4 2. All of the top-level Swing containers are heavyweight. What does that mean? 4

5 3. Given a choice between a lightweight component and a heavyweight component in Java AWT/Swing, you should use the former. Why? 5

6 4. In simulated OO in C, how do we cause type X to become the parent of type Y? 6

7 typedef struct { //... } X; typedef struct { X x_parent; //... } Y; 7

8 5 Suppose X is the parent of Y in simulated OO in C, what s the common way to access the fields of X? 8

9 Y* yobj; ( (X*) yobj )->x_field; get_x_field_1( (X*) yobj ); 9

10 6. How how do we achieve polymorphic effects in simulated OO in C? 10

11 X is the parent of Y. int function_for_x( X* xobj ) { //... } Y* yobj;... function_for_x( (X*) yobj ); Y* yobj; X* xobj = (X*) yobj; Y* yp = (Y*) xobj; 11

12 Overview of GNOME/GTK+ Widgets GNOME stands for GNU Object Modeling Environment. GNOME is designed for creating desktop environments. GNOME is an extension of the GTK+ package. The GTK+ package contains two libraries: GTK and GDK. 12

13 GTK stands for the GIMP Tool Kit. GIMP stands for the GNU Image Manipulation Program. GIMP, available free from the Open Source movement, is to Unix-like platforms what Photoshop is to Windows-based systems. GTK consists of a large collection of widgets for constructing windows and for layout control. The GDK library GDK stands for GIMP Drawing Kit provides numerous drawing functions and facilities for managing color, font, etc. 13

14 The fundamental data types used in GNOME, GTK+, GDK, GIMP, etc., are defined in the glib library of low-level C functions, macros, and structures. The glib library was created as a part of GIMP development for the purpose of standardization and portability. For example, anint in C may be represented by 16 bits in some machines and 32 in others. Similarly, a char may be signed in some and unsigned in others. By contrast, glib defines a type called gint for representing integers; a gint is always 32 bits. If your GNOME/GTK+ code needs a shorter integer, you can use gint8 for an 8-bit integer, or a gint16 for a 16-bit integer. Similarly, a gchar will always be signed. If you need an unsigned char, you can use guchar. 14

15 The glib library also comes with utility functions for memory management, string manipulation, and the formatting of textual output. GNOME/GTK+ programs will, for example, use g print() instead of printf(), g malloc() instead of malloc(), etc. 15

16 GtkObject ^ GnomeClient GnomeCanvasItem GnomeEntryEdit.. GnomeMDI GnomeMDIChild GnomeDockLayout GtkWidget GtkData GtkItemFactory GtkXmHTMLParser GnomeCanvasLine GnomeCanvasGroup GnomeCanvasPolygon GnomeCanvasRE GnomeCanvasImage GnomeCanvasRect GnomeCanvasText GnomeCanvasWidget GnomeCanvasEllipse GtkContainer GtkMisc GtkCalendar GtkRuler GnomeAnimator GnomePixmap GtkDial GtkEditable GtkRange GtkSeparator GtkProgress GtkDrawingArea GtkLabel GtkArrow GtkImage GtkPixmap GtkAccelLabel GtkClock GtkTipsQuery GtkBin GtkList GtkCList GtkFixed GtkNotebook GtkXmHTML GtkTRee GtkPacker GtkSocket GtkTable GtkPaned 16

17 GtkToolbar GtkMenuShell GnomeDock GnomeDockBand GtkBox GtkLayout GnomeCanvas GtkWindow GtkFrame GtkItem GtkInvisible GtkViewPort GtkDockItem GtkEventBox GtkHandleBox GtkButton GtkAspectFrame GtkScrolledWindow GtkMenuItem GtkListItem GtkTreeItem GtkCheckMenuItem GtkTearofMenuItem GtkPixmapMenuItem GnomeColorPicker GnomeHRef GtkToggleButton GtkOptionMenu GtkHBox GtkVBox GtkButtonbox GnomeProcBar GnomeAppBar GnomeFileEntry GtkStatusbar GtkCombo GnomeNumberEntry GnomeDialog GnomeApp GtkPlug GtkHButtonBox GtkVButtonbox GtkColorSlectionDialog GtkFileSlection GtkFontSelectionDialog 17

18 GnomeAbout GnomeMessageBox GnomePropertyBox GnomeScores 18

19 The GNOME/GTK+ widget types can be categorized in the same way that was shown earlier for AWT/Swing and for Qt. There are the top-level containers like GtkWindow that get displayed as windows on a terminal. There are intermediate level containers like GtkTable, GtkHBox, and so on, for creating different kinds of groupings of the more atomic widgets. There are atomic widgets like GtkButton, GtkEditable, GtkLabel, and so on, that actually get displayed in a window. And, finally, there are utility widgets like GtkLayout, GtkSeparator, and so on. 19

20 Many of the non-widget classes that hang from the root class GtkObject are meant for displaying graphics that can consist of shapes, images, text, etc. 20

21 Some Minimalist GUI Programs in Java AWT/Swing //FirstWindow.java import javax.swing.*; class FirstWindow { } public static void main(string[] args) { JFrame f = new JFrame( "FirstWindow" ); f.setsize( 300, 200 ); f.setlocation( 200, 300 ); f.setvisible( true ); } 21

22 A top-level container (JFrame, JApplet, JDialog, etc.) root pane (JRootPane) layered pane (JLayeredPane) MenuBar content pane (can be any Component) (the variable contentpane in JRootClass corresponds to this pane) glass pane (can be any Component) (the variable glasspane in JRootClass corresponds to this pane)

23 rootpane.getcontentpane().add( mywidget ); rootpane.getcontentpane().setlayout( mylayoutmanager ); 23

24 //FirstWindowWithButton.java import javax.swing.*; import java.awt.*; import java.awt.event.*; // for FlowLayout // for ActionListener class FirstWindowWithButton { public static void main(string[] args) { JFrame f = new JFrame( "FirstWindowWithButton" ); f.addwindowlistener(new WindowAdapter() { public void windowclosing(windowevent e) { System.exit(0); } }); JButton b = new JButton("Click Here for a Message"); b.setverticaltextposition( AbstractButton.CENTER ); b.sethorizontaltextposition( AbstractButton.CENTER ); b.addactionlistener( new ActionListener() { public void actionperformed( ActionEvent evt ) { System.out.println( "Have a Good Day!" ); } }); } } f.getcontentpane().setlayout( new FlowLayout() ); f.getcontentpane().add( b ); f.setlocation( 100, 50); f.pack(); f.setvisible( true ); 24

25 f.getcontentpane().setlayout( new FlowLayout() ); 25

26 Some Minimalist GUI Programs in C++ Qt Every GUI program in Qt must have the following two features: It must consist of exactly one object of type QApplication. Every GUI program in Qt must also specify one main widget. 26

27 #include <qapplication.h> #include <qmainwindow.h> int main( int argc, char **argv ) { QApplication myapp( argc, argv ); // (A) QMainWindow* mywin = new QMainWindow( 0, 0, 0 ); // (B) mywin->resize( 500, 300 ); // (C) mywin->move( 200, 100 ); // (D) } myapp.setmainwidget(mywin ); mywin->show(); return myapp.exec(); // (E) // (F) // (G) 27

28 QMainWindow::QMainWindow( QWidget* parent = 0, const char* name = 0, WFlags f = WType_TopLevel ); g++ -o firstwindow firstwindow.cc -I$QTDIR/include -L$QTDIR/lib -lqt 28

29 #include <qapplication.h> #include <qmainwindow.h> #include <qpushbutton.h> #include <qfont.h> int main( int argc, char **argv ) { QApplication myapp( argc, argv ); QMainWindow* mywin = new QMainWindow( 0, 0, 0 ); mywin->resize( 500, 300 ); mywin->move( 200, 100 ); // (A) // (B) // (C) // (D) QPushButton* quitbutton = new QPushButton( "Quit", mywin );// (E) quitbutton->resize( 60, 30 ); // (F) quitbutton->move( 220, 135 ); // (G) quitbutton->setfont( QFont( "Times", 18, QFont::Bold ) ); // (H) } QObject::connect( quitbutton, SIGNAL(clicked()), &myapp, SLOT(quit()) ); myapp.setmainwidget( mywin ); mywin->show(); return myapp.exec(); // (I) // (J) // (L) // (M) 29

30 Some Minimalist GUI Programs in GNOME/GTK+ #include <gnome.h> int main( int argc, char* argv[] ) { GtkWidget* toplevelwindow; // (A) // (B) } gnome_init( "gnomewin", "1.0", argc, argv ); // (C) toplevelwindow = gnome_app_new( "gnomewin", "Gnome Window" ); // (D) gtk_container_set_border_width( GTK_CONTAINER( toplevelwindow ), 200 ); // (E) gtk_widget_show( toplevelwindow ); // (F) gtk_main(); // (G) exit( 0 ); // (H) 30

31 gnome-config --cflags gnomeui -I/usr/include -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/lib/glib/include -I/usr/X11R6/include 31

32 CC=gcc LDLIBS= gnome-config --libs gnomeui CFLAGS=-Wall -g gnome-config --cflags gnomeui gnomewin: gnomewin.o Makefile_gnomewin $(CC) $(LDLIBS) gnomewin.o -o gnomewin gnomewin.o: gnomewin.c $(CC) $(CFLAGS) -c gnomewin.c clean: rm -f gnomewin rm -f gnomewin.o 32

33 #include <gnome.h> gint eventdestroy( GtkWidget* widget, GdkEvent* event, gpointer data ); // (A) int main( int argc, char* argv[] ) { GtkWidget* toplevelwindow; GtkWidget* mybutton; // (B) // (C) // (D) gnome_init( "buttonwin", "1.0", argc, argv ); // (E) toplevelwindow = gnome_app_new( "buttonwin", "My Window" );// (F) gtk_container_set_border_width( GTK_CONTAINER( toplevelwindow ), 100 ); // (G) mybutton = gtk_button_new_with_label( "Quit" ); // (H) gtk_signal_connect( GTK_OBJECT( mybutton ), "clicked", GTK_SIGNAL_FUNC( eventdestroy ), NULL ); gnome_app_set_contents( GNOME_APP( toplevelwindow ), mybutton ); // (I) } gtk_widget_show( toplevelwindow ); gtk_main(); exit( 0 ); // (J) // (K) // (L) gint eventdestroy( GtkWidget* widget, GdkEvent* event, gpointer data ) { // (M) gtk_main_quit(); // (N) return( 0 ); // (O) } 33

EE495K Slides by Avi Kak: OO for GUI Design (second lecture) Questions:

EE495K Slides by Avi Kak: OO for GUI Design (second lecture) Questions: EE495K Slides by Avi Kak: OO for GUI Design (second lecture) Questions: 1 1. Much of the history of modern GUI programming can be traced back to X. What is X and what was it mainly intended for? 2 2. What

More information

OO for GUI Design (contd.) Questions:

OO for GUI Design (contd.) Questions: OO for GUI Design (contd.) Questions: 1 1. What is a window manager and what are its responsibilities? 2 2. How would you define an event in the context of GUI programming? 3 3. What is the first thing

More information

Lecture 3. GUI Programming part 1: GTK

Lecture 3. GUI Programming part 1: GTK INTRODUCTION TO DESIGN AUTOMATION Lecture 3. GUI Programming part 1: GTK Guoyong Shi, PhD shiguoyong@ic.sjtu.edu.cn School of Microelectronics Shanghai Jiao Tong University Fall 2010 2010-9-15 Slide 1

More information

EE495K Slides by Avi Kak: OO for GUI Design (contd.) Questions:

EE495K Slides by Avi Kak: OO for GUI Design (contd.) Questions: EE495K Slides by Avi Kak: OO for GUI Design (contd.) Questions: 1 1. What are the two features of every GUI program in Qt? 2 2. How are the parent-child connections established in the containment hierarchy

More information

Container Widgets and Packing

Container Widgets and Packing Container Widgets and Packing As mentioned in Chapter 2, there are two kinds of containers, those that can hold no more than one child widget, and those that can hold more than one. Containers that can

More information

Creating GNOME Applications with Glade. Part I: Introduction

Creating GNOME Applications with Glade. Part I: Introduction Creating GNOME Applications with Glade Part I: Introduction Glade 3 Glade 3 is a tool to enable quick and easy development of Uis for the GTK+ toolkit and GNOME desktop environment. User interfaces designed

More information

t GTK+ Object # widget, [ W< z< sl. y Widget E / Xlib E 8 Csq ;, #,., $ Gtk widget object GWuS vv q. A o. # widget x C widget # X L. B #, D #( *), " #

t GTK+ Object # widget, [ W< z< sl. y Widget E / Xlib E 8 Csq ;, #,., $ Gtk widget object GWuS vv q. A o. # widget x C widget # X L. B #, D #( *),  # GTK Tutorial Ian Main imain@gtk.org, Tony Gale gale@gtk.org 1998[ 5 24 ts liberta@cau.ac.kr, hanjiho@penta.co.kr 1998[ 5 25 C 1 < & 2 S B GTK Tutorial. GTK+ W W http://www.gtk. org/.? Z (3/??), Tutorial

More information

Lesson 2: GTK+ Basics

Lesson 2: GTK+ Basics 1 A First GTK+ Program We will begin with a very simple GTK+ program in order to demonstrate some of the key tasks that every GTK+ main program must perform. The program, hello_world.c, is found in many

More information

GTK+ FAQ. Tony Gale Shawn Amundson Emmanuel Deloget

GTK+ FAQ. Tony Gale Shawn Amundson Emmanuel Deloget GTK+ FAQ Tony Gale Shawn Amundson Emmanuel Deloget GTK+ FAQ by Tony Gale, Shawn Amundson, and Emmanuel Deloget This document is intended to answer questions that are likely to be frequently asked by programmers

More information

C SCI The X Window System Stewart Weiss

C SCI The X Window System Stewart Weiss The X Window System The X Window System is a networking and display protocol which provides windowing on bitmapped displays. X provides the basic framework for building GUI environments, such as drawing

More information

Review. Designing Interactive Systems II. Introduction. Web 2.0 in keywords GWT Cappuccino HTML5. Cross platform GUI Toolkit

Review. Designing Interactive Systems II. Introduction. Web 2.0 in keywords GWT Cappuccino HTML5. Cross platform GUI Toolkit Review Designing Interactive Systems II Computer Science Graduate Programme SS 2010 Prof. Dr. RWTH Aachen University Web 2.0 in keywords GWT Cappuccino HTML5 http://hci.rwth-aachen.de 1 2 Introduction

More information

Designing Interactive Systems II

Designing Interactive Systems II Designing Interactive Systems II Computer Science Graduate Programme SS 2010 Prof. Dr. RWTH Aachen University http://hci.rwth-aachen.de 1 Review 2 Review Web 2.0 in keywords 2 Review Web 2.0 in keywords

More information

Example: CharCheck. That s It??! What do you imagine happens after main() finishes?

Example: CharCheck. That s It??! What do you imagine happens after main() finishes? Event-Driven Software Paradigm Today Finish Programming Unit: Discuss Graphics In the old days, computers did exactly what the programmer said Once started, it would run automagically until done Then you

More information

for more please visit :

for more please visit : articlopedia.gigcities.com for more please visit : http://articlopedia.gigcities.com file:///d /important.html9/13/2006 8:50:19 PM Revisited: Building Cross Platform GUI Apps With PHP GTK PHP is not just

More information

Systems Programming Graphical User Interfaces

Systems Programming Graphical User Interfaces Systems Programming Graphical User Interfaces Julio Villena Román (LECTURER) CONTENTS ARE MOSTLY BASED ON THE WORK BY: José Jesús García Rueda Systems Programming GUIs based on Java

More information

Graphical User Interfaces (GUIs)

Graphical User Interfaces (GUIs) CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox

More information

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User CSE3461 Control Flow Paradigms: Reacting to the User Control Flow: Overview Definition of control flow: The sequence of execution of instructions in a program. Control flow is determined at run time by

More information

CSEN401 Computer Programming Lab. Topics: Graphical User Interface Window Interfaces using Swing

CSEN401 Computer Programming Lab. Topics: Graphical User Interface Window Interfaces using Swing CSEN401 Computer Programming Lab Topics: Graphical User Interface Window Interfaces using Swing Prof. Dr. Slim Abdennadher 22.3.2015 c S. Abdennadher 1 Swing c S. Abdennadher 2 AWT versus Swing Two basic

More information

MIT AITI Swing Event Model Lecture 17

MIT AITI Swing Event Model Lecture 17 MIT AITI 2004 Swing Event Model Lecture 17 The Java Event Model In the last lecture, we learned how to construct a GUI to present information to the user. But how do GUIs interact with users? How do applications

More information

Programming Languages and Techniques (CIS120e)

Programming Languages and Techniques (CIS120e) Programming Languages and Techniques (CIS120e) Lecture 29 Nov. 19, 2010 Swing I Event- driven programming Passive: ApplicaHon waits for an event to happen in the environment When an event occurs, the applicahon

More information

Packages: Putting Classes Together

Packages: Putting Classes Together Packages: Putting Classes Together 1 Introduction 2 The main feature of OOP is its ability to support the reuse of code: Extending the classes (via inheritance) Extending interfaces The features in basic

More information

Maemo Diablo Reference Manual for maemo 4.1. Application Development

Maemo Diablo Reference Manual for maemo 4.1. Application Development Maemo Diablo Reference Manual for maemo 4.1 Application Development December 22, 2008 Contents 1 Application Development 3 1.1 Introduction.............................. 3 1.2 Typical Maemo GUI Application..................

More information

Lab 12: GUI programming with Qt

Lab 12: GUI programming with Qt Lab 12: GUI programming with Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 Outline 1 (Pronounced cute ) https://www.qt.io/what-is-qt/ https://showroom.qt.io/ https://en.wikipedia.org/wiki/_(software)

More information

Points Missed on Page page 1 of 8

Points Missed on Page page 1 of 8 Midterm II - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total. Name: ID: Problem #1 (8 points) Rewrite the following code segment using a for loop instead of a while loop (that is

More information

Introduction. Introduction

Introduction. Introduction Introduction Many Java application use a graphical user interface or GUI (pronounced gooey ). A GUI is a graphical window or windows that provide interaction with the user. GUI s accept input from: the

More information

Java: Graphical User Interfaces (GUI)

Java: Graphical User Interfaces (GUI) Chair of Software Engineering Carlo A. Furia, Marco Piccioni, and Bertrand Meyer Java: Graphical User Interfaces (GUI) With material from Christoph Angerer The essence of the Java Graphics API Application

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

The FFI Reference Manual

The FFI Reference Manual The FFI Reference Manual a Foreign Function Interface (version 0.2) for MIT/GNU Scheme version 9.0.1 2011-09-19 by Matt Birkholz This manual documents FFI 0.2. Copyright c 1986, 1987, 1988, 1989, 1990,

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Frames, GUI and events Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Introduction to Swing The Java AWT (Abstract Window Toolkit)

More information

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphic User Interfaces. - GUI concepts - Swing - AWT Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations

More information

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in Lab 4 D0010E Object-Oriented Programming and Design Lecture 9 Lab 4: You will implement a game that can be played over the Internet. The networking part has already been written. Among other things, the

More information

Programming Language Concepts: Lecture 8

Programming Language Concepts: Lecture 8 Programming Language Concepts: Lecture 8 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 8, 11 February 2009 GUIs and event

More information

Eclipsing Your IDE. Figure 1 The first Eclipse screen.

Eclipsing Your IDE. Figure 1 The first Eclipse screen. Eclipsing Your IDE James W. Cooper I have been hearing about the Eclipse project for some months, and decided I had to take some time to play around with it. Eclipse is a development project (www.eclipse.org)

More information

Drawing in GTK+ Background. Windows and Clipping. CSci Graphical User Interface Programming Drawing in GTK+ Prof.

Drawing in GTK+ Background. Windows and Clipping. CSci Graphical User Interface Programming Drawing in GTK+ Prof. Background In order to understand how to draw in GTK, you rst have to understand something about how GTK draws widgets, because how GTK draws widgets has an important role in how you design your drawing

More information

Java & Graphical User Interface II. Wang Yang wyang AT njnet.edu.cn

Java & Graphical User Interface II. Wang Yang wyang AT njnet.edu.cn Java & Graphical User Interface II Wang Yang wyang AT njnet.edu.cn Outline Review of GUI (first part) What is Event Basic Elements of Event Programming Secret Weapon - Inner Class Full version of Event

More information

Reference Manual for SLgtk Version Michael S. Noble, Jul 21, 2010

Reference Manual for SLgtk Version Michael S. Noble, Jul 21, 2010 Reference Manual for SLgtk Version 0.7.6 Michael S. Noble, mnoble@space.mit.edu Jul 21, 2010 ii Preface SLgtk is a software package which provides Gtk bindings for the S-Lang scripting language. Copyright

More information

CS 251 Intermediate Programming GUIs: Components and Layout

CS 251 Intermediate Programming GUIs: Components and Layout CS 251 Intermediate Programming GUIs: Components and Layout Brooke Chenoweth University of New Mexico Fall 2017 import javax. swing.*; Hello GUI public class HelloGUI extends JFrame { public HelloGUI ()

More information

Qt-Based Implementation of Low Level ROOT Graphical Layer

Qt-Based Implementation of Low Level ROOT Graphical Layer Qt-Based Implementation of Low Level ROOT Graphical Layer By V.Fine ROOT Low Level Graphics Level It is well-known that ROOT package has been ported to many different platforms which include the various

More information

Graphical Interfaces

Graphical Interfaces Weeks 11&12 Graphical Interfaces All the programs that you have created until now used a simple command line interface, which is not user friendly, so a Graphical User Interface (GUI) should be used. The

More information

PRINCIPLES OF OPERATING SYSTEMS

PRINCIPLES OF OPERATING SYSTEMS PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)

More information

Find it faster at

Find it faster at Index Symbols # (comments), using with RC files, 326 & (ampersand), using with PHP-GTK applications, 23 * (asterisk) wildcard, using with style rules, 322 _ (underscore), using with mnemonics, 131 A -a

More information

Graphical Interfaces

Graphical Interfaces Weeks 9&11 Graphical Interfaces All the programs that you have created until now used a simple command line interface, which is not user friendly, so a Graphical User Interface (GUI) should be used. The

More information

Part 3: Graphical User Interface (GUI) & Java Applets

Part 3: Graphical User Interface (GUI) & Java Applets 1,QWURGXFWLRQWR-DYD3URJUDPPLQJ (( Part 3: Graphical User Interface (GUI) & Java Applets EE905-GUI 7RSLFV Creating a Window Panels Event Handling Swing GUI Components ƒ Layout Management ƒ Text Field ƒ

More information

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation KF5008 Program Design & Development Lecture 1 Usability GUI Design and Implementation Types of Requirements Functional Requirements What the system does or is expected to do Non-functional Requirements

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Programming with Clutter. Murray Cumming

Programming with Clutter. Murray Cumming Programming with Clutter Murray Cumming Programming with Clutter by Murray Cumming Copyright 2007, 2008 Openismus GmbH We very much appreciate any reports of inaccuracies or other errors in this document.

More information

Top-Level Containers

Top-Level Containers 1. Swing Containers Swing containers can be classified into three main categories: Top-level containers: JFrame, JWindow, and JDialog General-purpose containers: JPanel, JScrollPane,JToolBar,JSplitPane,

More information

Interfaces & Polymorphism part 2: Collections, Comparators, and More fun with Java graphics

Interfaces & Polymorphism part 2: Collections, Comparators, and More fun with Java graphics Interfaces & Polymorphism part 2: Collections, Comparators, and More fun with Java graphics 1 Collections (from the Java tutorial)* A collection (sometimes called a container) is simply an object that

More information

Graphical interfaces & event-driven programming

Graphical interfaces & event-driven programming Graphical interfaces & event-driven programming Lecture 12 of TDA 540 (Objektorienterad Programmering) Carlo A. Furia Alex Gerdes Chalmers University of Technology Gothenburg University Fall 2017 Pop quiz!

More information

(Incomplete) History of GUIs

(Incomplete) History of GUIs CMSC 433 Programming Language Technologies and Paradigms Spring 2004 Graphical User Interfaces April 20, 2004 (Incomplete) History of GUIs 1973: Xerox Alto 3-button mouse, bit-mapped display, windows 1981:

More information

Open source MySQL Browser for Open Innovation

Open source MySQL Browser for Open Innovation Open source MySQL Browser for Open Innovation Lecturer Radu Bucea-Manea-Tonis, PhD 1 1 mysqlbrowser.codeplex.com Abstract. Our purpose is to cross-compile MySQL driver source code for Linux on Windows

More information

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling Handout 12 CS603 Object-Oriented Programming Fall 15 Page 1 of 12 Handout 14 Graphical User Interface (GUI) with Swing, Event Handling The Swing library (javax.swing.*) Contains classes that implement

More information

MODEL UPDATES MANIPULATES USER

MODEL UPDATES MANIPULATES USER 1) What do you mean by MVC architecture? Explain its role in modern applications and list its advantages(may-2013,jan-2013,nov-2011). In addition to dividing the application into three kinds of components,

More information

Object-Oriented Programming

Object-Oriented Programming iuliana@cs.ubbcluj.ro Babes-Bolyai University 2018 1 / 33 Overview 1 2 3 4 5 6 2 / 33 I Qt is a cross-platform application and UI framework in C++. Using Qt, one can write GUI applications once and deploy

More information

University of Cape Town ~ Department of Computer Science. Computer Science 1016S / 1011H ~ November Exam

University of Cape Town ~ Department of Computer Science. Computer Science 1016S / 1011H ~ November Exam Name: Please fill in your Student Number and Name. Student Number : Student Number: University of Cape Town ~ Department of Computer Science Computer Science 1016S / 1011H ~ 2009 November Exam Question

More information

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing Introduction to Graphical Interface Programming in Java Introduction to AWT and Swing GUI versus Graphics Programming Graphical User Interface (GUI) Graphics Programming Purpose is to display info and

More information

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread G51PGP Programming Paradigms Lecture 008 Inner classes, anonymous classes, Swing worker thread 1 Reminder subtype polymorphism public class TestAnimals public static void main(string[] args) Animal[] animals

More information

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7 PROGRAMMING DESIGN USING JAVA (ITT 303) Graphical User Interface Unit 7 Learning Objectives At the end of this unit students should be able to: Build graphical user interfaces Create and manipulate buttons,

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 25 17/01/13 11:45 Swing Graphical User Interface (GUI) 2 of 25 17/01/13 11:45 Graphical

More information

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 143 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/

More information

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson)

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson) Graphics programming COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson) Overview Aims To provide an overview of Swing and the AWT To show how to build

More information

Lecture 5: Java Graphics

Lecture 5: Java Graphics Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,

More information

CS 4300 Computer Graphics

CS 4300 Computer Graphics CS 4300 Computer Graphics Prof. Harriet Fell Fall 2011 Lecture 8 September 22, 2011 GUIs GUIs in modern operating systems cross-platform GUI frameworks common GUI widgets event-driven programming Model-View-Controller

More information

CSC 1214: Object-Oriented Programming

CSC 1214: Object-Oriented Programming CSC 1214: Object-Oriented Programming J. Kizito Makerere University e-mail: jkizito@cis.mak.ac.ug www: http://serval.ug/~jona materials: http://serval.ug/~jona/materials/csc1214 e-learning environment:

More information

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Announcements A3 is up, due Friday, Oct 10 Prelim 1 scheduled for Oct 16 if you have a conflict, let us know now 2 Interactive

More information

COMP 2400 UNIX Tools

COMP 2400 UNIX Tools COMP 2400 UNIX Tools Christian Grothoff christian@grothoff.org http://grothoff.org/christian/ 1 GTK+ GTK+ = Gimp Tool Kit, Manipulation Program GIMP = GNU Image Basis for Gnome Written in C, bindings for

More information

C Libraries. Using GLib. Ph. D. Eng. Lucjan Miękina upel.agh.edu.pl/wimir/login/ Department of Robotics and Mechatronics 1/31

C Libraries. Using GLib. Ph. D. Eng. Lucjan Miękina upel.agh.edu.pl/wimir/login/ Department of Robotics and Mechatronics 1/31 1/31 C Libraries Using GLib Ph. D. Eng. Lucjan Miękina upel.agh.edu.pl/wimir/login/ Department of Robotics and Mechatronics January 10, 2017 2/31 Programming in C External libraries - GLib If you re writing

More information

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"

More information

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun! Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques

More information

Swing from A to Z Some Simple Components. Preface

Swing from A to Z Some Simple Components. Preface By Richard G. Baldwin baldwin.richard@iname.com Java Programming, Lecture Notes # 1005 July 31, 2000 Swing from A to Z Some Simple Components Preface Introduction Sample Program Interesting Code Fragments

More information

Cake: a tool for adaptation of object code

Cake: a tool for adaptation of object code Cake: a tool for adaptation of object code Stephen Kell Stephen.Kell@cl.cam.ac.uk Computer Laboratory University of Cambridge Cake... p.1/32 Some familiar problems Software is expensive to develop expensive

More information

CS 2113 Software Engineering

CS 2113 Software Engineering CS 2113 Software Engineering Java 5 - GUIs Import the code to intellij https://github.com/cs2113f18/template-j-5.git Professor Tim Wood - The George Washington University Class Hierarchies Abstract Classes

More information

DM503 Programming B. Peter Schneider-Kamp.

DM503 Programming B. Peter Schneider-Kamp. DM503 Programming B Peter Schneider-Kamp petersk@imada.sdu.dk! http://imada.sdu.dk/~petersk/dm503/! ADVANCED OBJECT-ORIENTATION 2 Object-Oriented Design classes often do not exist in isolation from each

More information

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC). The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT) was part of the JDK form the beginning,

More information

Java Graphical User Interfaces

Java Graphical User Interfaces Java Graphical User Interfaces 1 The Abstract Windowing Toolkit (AWT) Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT)

More information

Introduction. Overview of the Course on Java. Overview of Part 1 of the Course

Introduction. Overview of the Course on Java. Overview of Part 1 of the Course Introduction Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu /~spring Overview of the Course on Java Part

More information

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming

More information

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community CSCI-43 Exam Review February, 01 Presented by the RIT Computer Science Community http://csc.cs.rit.edu C Preprocessor 1. Consider the following program: 1 # include 3 # ifdef WINDOWS 4 # include

More information

Graphical User Interface (Part-1) Supplementary Material for CPSC 233

Graphical User Interface (Part-1) Supplementary Material for CPSC 233 Graphical User Interface (Part-1) Supplementary Material for CPSC 233 Introduction to Swing A GUI (graphical user interface) is a windowing system that interacts with the user The Java AWT (Abstract Window

More information

Building Graphical User Interfaces. GUI Principles

Building Graphical User Interfaces. GUI Principles Building Graphical User Interfaces 4.1 GUI Principles Components: GUI building blocks Buttons, menus, sliders, etc. Layout: arranging components to form a usable GUI Using layout managers. Events: reacting

More information

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming Objectives: Last revised 1/15/10 1. To introduce the notion of a component and some basic Swing components (JLabel, JTextField, JTextArea,

More information

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

The Past, Present, and Future of SWT

The Past, Present, and Future of SWT The Past, Present, and Future of SWT Eric Williams Email: ericwill@redhat.com Twitter: @yyzericwill About me: Eric Williams - Studied computer science at the University of Toronto - Intern at Red Hat from

More information

Original GUIs. IntroGUI 1

Original GUIs. IntroGUI 1 Original GUIs IntroGUI 1 current GUIs IntroGUI 2 Why GUIs? IntroGUI 3 Computer Graphics technology enabled GUIs and computer gaming. GUI's were 1985 breakout computer technology. Without a GUI there would

More information

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming GUI Design Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu /~spring Overview of Part 1 of the Course Demystifying

More information

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall (total 7 pages)

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall (total 7 pages) 1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2002 (total 7 pages) Name: TA s Name: Tutorial: For Graders Question 1 Question 2 Question 3 Total Problem 1 (20 points) True or

More information

Example 3-1. Password Validation

Example 3-1. Password Validation Java Swing Controls 3-33 Example 3-1 Password Validation Start a new empty project in JCreator. Name the project PasswordProject. Add a blank Java file named Password. The idea of this project is to ask

More information

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide Topics for Exam 2: Queens College, CUNY Department of Computer Science CS 212 Object-Oriented Programming in Java Practice Exam 2 CS 212 Exam 2 Study Guide Linked Lists define a list node define a singly-linked

More information

Building Graphical User Interfaces. Overview

Building Graphical User Interfaces. Overview Building Graphical User Interfaces 4.1 Overview Constructing GUIs Interface components GUI layout Event handling 2 1 GUI Principles Components: GUI building blocks. Buttons, menus, sliders, etc. Layout:

More information

DM550 / DM857 Introduction to Programming. Peter Schneider-Kamp

DM550 / DM857 Introduction to Programming. Peter Schneider-Kamp DM550 / DM857 Introduction to Programming Peter Schneider-Kamp petersk@imada.sdu.dk http://imada.sdu.dk/~petersk/dm550/ http://imada.sdu.dk/~petersk/dm857/ GRAPHICAL USER INTERFACES 2 HelloWorld Reloaded

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 32 April 9, 2018 Swing I: Drawing and Event Handling Chapter 29 HW8: Spellchecker Available on the web site Due: Tuesday! Announcements Parsing, working

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

Praktische Aspekte der Informatik

Praktische Aspekte der Informatik Praktische Aspekte der Informatik Moritz Mühlhausen Prof. Marcus Magnor https://graphics.tu-bs.de/teaching/ws1718/padi/ 1 Your Proposal It s due 17.11.2017! https://graphics.tu-bs.de/teaching/ws1718/padi/

More information

Java. GUI building with the AWT

Java. GUI building with the AWT Java GUI building with the AWT AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many applications Uses the controls defined by your OS therefore

More information

Background Information About GTK+ and Related Libraries

Background Information About GTK+ and Related Libraries Background Information About GTK+ and Related Libraries The X Window System The X Window System is a networking and display protocol which provides windowing on bitmapped displays. X provides the basic

More information

Prototyping a Swing Interface with the Netbeans IDE GUI Editor

Prototyping a Swing Interface with the Netbeans IDE GUI Editor Prototyping a Swing Interface with the Netbeans IDE GUI Editor Netbeans provides an environment for creating Java applications including a module for GUI design. Here we assume that we have some existing

More information

Java Programming Lecture 6

Java Programming Lecture 6 Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components

More information

SINGLE EVENT HANDLING

SINGLE EVENT HANDLING SINGLE EVENT HANDLING Event handling is the process of responding to asynchronous events as they occur during the program run. An event is an action that occurs externally to your program and to which

More information