Thinlets GUI Seminar Princeton 27/4 2004 Peter Kriens.

Slides:



Advertisements
Similar presentations
1 Graphical User Interface (GUI) Applications Abstract Windowing Toolkit (AWT) Events Handling Applets.
Advertisements

Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Recitation 4. 2-D arrays. Exceptions. Animal[] v= new Animal[3]; 2 declaration of array v v null Create array of 3 elements a6 Animal[] null Assign.
pa 1 Porting BETA to ROTOR ROTOR Projects Presentation Day, June by Peter Andersen.
Java Applets:. How Applets differ from application?: They do not use main method but init(), start() and paint() methods of the applet class They can.
Copyright  Oracle Corporation, All rights reserved. 3 JavaBeans: Reusing Application Components.
CMSC 341 Building Java GUIs. 09/26/2007 CMSC 341 GUI 2 Why Java GUI Development? Course is about Data Structures, not GUIs. We are giving you the opportunity.
Introduction to Java Classes, events, GUI’s. Understand: How to use TextPad How to define a class or object How to create a GUI interface How event-driven.
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 Early GUIs with Java As presented in Java: Complete Course in Programming and Problem Solving by Lambert and Osborne.
Multiple Device User Interface A Rule Approach Paul D. Johnson Final Presentation (SE690) Supervised by Dr. Jia
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 9, 2004 Last update:
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
CS3157 Java UI Recitation. Material Covered: Overview of AWT components, Event Handling, creating applets, and sample UI. Not covered in recitation: Drawing,
Chapter 7 Improving the User Interface
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Io package as Java’s basic I/O system continue’d.
Creating of Rich Client Applications using NetBeans 6 and Java Swing Miroslav Nachev.
© 2008 IBM Corporation Emerging Internet Technologies Real World Accessibility with ARIA Becky Gibson Web Accessibility Architect.
AWT Components (Chapter 9) Java Certification Study Group January 21, 1999 Mark Roth.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
GUI’s Part Two wxWidgets components. Resources for wxWidgets Sample code on course website wxWidgets web site.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Review Session for EXCEPTIONS & GUIS -David Gries 1 Adapted from Previous Review Slides.
Applets Life Cycle Drawing and Event Handling Methods for UI Components Applet Capabilities Example.
MIT AITI 2003 Lecture 17. Swing - Part II. The Java Event Model Up until now, we have focused on GUI's to present information (with one exception) Up.
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
ICALEPCS, “jddd” a Java DOOCS Data Display for the XFEL Editor for a Graphical User Interface of DOOCS & TINE and Runtime Engine Elke Sombrowski.
Java Programming: Guided Learning with Early Objects
Java GUI Framework Developed for Tantivy EMS System (October 1999 to August 2000)
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Computer Science 112 Fundamentals of Programming II Command Buttons and Responding to Events.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
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.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Chapter 12 Handling Exceptions and Events. Chapter Objectives Learn what an exception is Become aware of the hierarchy of exception classes Learn about.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
1 Lesson: Applets with User Input and Output with GUI ICS4M.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
Java Applet Basics (2). The Body Mass Index Calculator.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming – Home and reload buttons for the webbrowser, Applets.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
May 12, 1998CS102-01Lecture 7-3 Building GUIs in Java I CS Lecture 7-3 A picture's worth a thousand words.
Csc Basic Graphical User Interface (GUI) Components.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Copyright © Curt Hill More Widgets In Abstract Window Toolbox.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Creating a GUI Class An example of class design using inheritance and interfaces.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
COMPOSITE PATTERN NOTES. The Composite pattern l Intent Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED FORMS.
Computer Science 112 Fundamentals of Programming II Data Fields for I/O and Message Boxes for Error Recovery.
Java FX: Scene Builder.
“Form Ever Follows Function” Louis Henri Sullivan
Abstract Window ToolKit (AWT)
Chap 7. Building Java Graphical User Interfaces
GUI Using Python.
Graphical User Interfaces -- Introduction
Introduction to Graphical Interface Programming in Java
Recall: Timeline Class
AWT Components and Containers
CISC124 Last Quiz this week. Topics listed in last Tuesday’s lecture.
Constructors, GUI’s(Using Swing) and ActionListner
The Recursive Descent Algorithm
First Window Builder Program
Presentation transcript:

Thinlets GUI Seminar Princeton 27/ Peter Kriens

Thinlets

XML Based GUI Based on AWT (Java 1.1) One class! Internationalization Reflection for binding XML to code Recursive Decent set of widgets Extensible Compressed size 38K! GNU Lesser Public License

Architecture Thinlet 10,1 Object[] Object[0]Object[1] keyvalue Frame Launcher Applet Launcher YourApp XML handler (through reflection)

Calculator, XML File

Calculator, Source Code package thinlet.demo; import thinlet.*; public class Calculator extends Thinlet { public Calculator() throws Exception { add(parse("calculator.xml")); } public void calculate(String number1, String number2, Object result) { try { int i1 = Integer.parseInt(number1); int i2 = Integer.parseInt(number2); setString(result, "text", String.valueOf(i1 + i2)); } catch (NumberFormatException nfe) { getToolkit().beep(); } public static void main(String[] args) throws Exception { new FrameLauncher("Calculator", new Calculator(), 320, 240); } action="calculate(number1.text, number2.text, result)"

Event Handling Parse methods –public Object parse(String path) throws IOException public Object parse(String path, Object handler) throws IOException public Object parse(InputStream inputstream) throws IOException public Object parse(InputStream inputstream, Object handler) throws IOException The widget (in the same XML file) identified by the given name, its type is Object. – –public void one() {} public void two(Thinlet thinlet, Object button, Object label) {} item The component part on which the event occurred, valid for list item, tree node, table row, combobox choice, and tabbedpane tab. this/name/item.attribute – –public void three(String buttontext, Image buttonicon, boolean labelvisible, int labelcols) {} public void four(Object item, String itemtext, Image itemicon) {}

Components Component PopupMenu Label Button CheckBox ToggleButton ComboBox TextField PasswordField TextArea TabbedPane Panel Desktop Dialog SpinBox ProgressBar Slider SplitPane List Table Tree Separator MenuBar

Showcase

Theodor, XUL editor

Skinning

Layout Simple Layout Model –Based on rows and columns –Panels are used to define a basic layout –Min size supported Rectangular based

Coding Style: No OO Code seems hard to maintain –Large single class –Implements method dispatching in code Performance might be an issue –All methods and fields have to be looked up … if ("spinbox" == classname) { Dimension size = getFieldSize(component); size.width += block; return size; } if ("progressbar" == classname) { boolean horizontal = ("vertical" != get(component, "orientation")); return new Dimension(horizontal ? 76 : 6, horizontal ? 6 : 76); } if ("slider" == classname) { boolean horizontal = ("vertical" != get(component, "orientation")); return new Dimension(horizontal ? 76 : 10, horizontal ? 10 : 76); } if ("splitpane" == classname) { …

Then Again The small size of the total package seems to make this problem manageable –Would like a single component class though …

Conclusion LGPL might be an issue Not clear how easy it is to do skinning –Skinlet: 09-Sep-03 - Version beta, bugfix release. Minor bugfixes and improvements. I decided to temporarily suspend Skinlet development until it gets clear what the future refactored Thinlet will look like. This is mainly because the current one-class structure makes it really hard to keep up-to- date with each Thinlet update. Rectangular based layout is too restrictive for CE Basic skin is not very nice Performance Hard to extend with new widgets Basic model is very easy to use Thinlets recursive architecture makes it suitable to OSGi GUI editor available Internationalization Small … Checks binding early