1 First BlueJ Day, Houston, Texas, 1st March 2006 Writing BlueJ Extensions Ian Utting University of Kent.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 22 GUI Programming I.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Unit 3 Graphical User Interface (GUI) Dr. Magdi AMER.
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.
 Copyright 2005 Digital Enterprise Research Institute. All rights reserved. The Web Services Modeling Toolkit Mick Kerrigan.
 Copyright 2005 Digital Enterprise Research Institute. All rights reserved. The WSML Editor Plugin to the Web Services Modeling Toolkit Mick.
Unit 091 Introduction to GUI Programming Introduction to User Interfaces Introduction to GUI Programming GUI Design Issues GUI Programming Issues Java.
1 Chapter 7 Graphics and Event Handling. 2 Overview The java.awt and javax.swing packages and their subpackages support graphics and event handling. Many.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
Listener Interfaces  A mechanism for registering handlers that respond to external events  Motivation: Develop a Canvas class that:  supports drawing.
Eclipse Introduction Dwight Deugo Nesa Matic
Prometheus Design Tool (CAFnE Extension) v0.1: WeatherApplication.pd PDT/CAFnE Workspace is organized into four main panes Component Descriptor pane contains.
Views Dwight Deugo Nesa Matic
Protection of Agent Teamwork By Jeremy Hall. Agent Teamwork Overview ● Mobile agent framework  AgentTeamwork 2 is a mobile-agent based middleware system.
Java Beans Component Technology Integrated, Visual Development Environments Reusable Platform-Independent Modular.
Graphic User Interfaces Part 1. Typical GUI Screen from Microsoft Word What GUI “components” can you see? –Menus? Buttons? Labels? What else? –Anything.
JSP and Servlets Lecture notes by Theodoros Anagnostopoulos.
Presented by…. Group 2 1. Programming language 2Introduction.
A First Program Using C#
Java Beans.
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
Zubanov Alexei, 2006 Aug 07 – Sep 28 QtROOT package extension with Coin3D lib.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Chapter 3 Introduction to Collections – Stacks Modified
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Introduction to Matlab & Data Analysis
Automated GUI testing How to test an interactive application automatically?
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Integrated Development Environment (IDE)
School of Computer Science & Information Technology G6DICP - Lecture 17 GUI (Graphical User Interface) Programming.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
SWING IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
1 First BlueJ Day, Houston, Texas, 1st March 2006 The Submitter Extension Ian Utting University of Kent.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Java Bean Definition “A Java Bean is a reusable software component that can be manipulated visually in a builder tool.”
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.
the First BlueJ Day Houston, 2006 Matthew C. Jadud University of Kent.
Introduction to Java Beans CIS 421 Web-based Java Programming.
Applets Yong Choi School of Business CSU, Bakersfield.
Creating Windows. How can we use Java to create programs that use windows (GUI applications)? How can we use Java to create programs that use windows.
First Bean Compose SimpleBean Demo Simple Bean Discuss Manifest and Jar Add Properties to SimpleBean.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
® IBM Software Group © 2007 IBM Corporation Module 1: Getting Started with Rational Software Architect Essentials of Modeling with IBM Rational Software.
Oracle Forms Oracle Forms Builder provides various tools, which have powerful Graphical User Interfaces (GUI's) to design such forms. All objects, properties,
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
CSC 205 Programming II Lecture 5 AWT - I.
Javascript and Dynamic Web Pages: Client Side Processing
More Sophisticated Behavior
Working with Client-Side Scripting
Java Beans Sagun Dhakhwa.
PRG 421 GUIDE Higher Education / prg421guide.com.
PRG 421 MART Higher Education / prg421mart.com
PRG 421 GUIDE Lessons in Excellence -- prg421guide.com.
Object Oriented Theory I
Extend Text Editor to Draw shapes
Java External Libraries & Case Study
CISC124 Assignment 4 on Inheritance due next Friday.
Constructors, GUI’s(Using Swing) and ActionListner
Plug-In Architecture Pattern
Presentation transcript:

1 First BlueJ Day, Houston, Texas, 1st March 2006 Writing BlueJ Extensions Ian Utting University of Kent

2 First BlueJ Day, Houston, Texas, 1st March 2006 Aims of the Extensions API To allow you to do programmatically what users can do through the BlueJ GUI: –Add menu items to the BlueJ GUI for packages, classes and objects –Create and interrogate projects, packages, classes and objects (and their BlueJ GUI representations) –Interact with source code through the editor

3 First BlueJ Day, Houston, Texas, 1st March 2006 Why? To allow you to extend BlueJ with stuff only you need (or you only need sometimes) To use BlueJ as a tool for researching student behaviour (As a source of undergraduate projects)

4 First BlueJ Day, Houston, Texas, 1st March 2006 Overview – an Extension is: A single jar file containing (at least) a class which extends bluej.extensions.Extension (the Jar’s MainClass attribute should name this class) The Jar can be installed system-wide, per-user or per-project. Tip: don’t rely on external class libraries, bundle them with your extension

5 First BlueJ Day, Houston, Texas, 1st March 2006 abstract class Extension Provides (and requires) version and compatibility information. Requires: –abstract void startup(BlueJ bluej) called when the extension can start –void terminate() called when the extension is about to be unloaded Watch out: version request calls can occur at any time, don’t use static initialisers of heavyweight constructors.

6 First BlueJ Day, Houston, Texas, 1st March 2006 class BlueJ Acts as a proxy for the BlueJ application Allows an extension to: –Create and open BlueJ projects, and identify the “current” package –Add Listeners for various events –Get/set persistent properties –Register menu and preference panel generators

7 First BlueJ Day, Houston, Texas, 1st March 2006 Menus Extensions can add a menu item (or sub-menu) to the Tools, Class and Object menus. Don’t share them, or hold onto them, or rely on when BlueJ might ask for them. BlueJ will call you back on the notifyPost methods just before displaying your menu (so you can enable/disable your items).

8 First BlueJ Day, Houston, Texas, 1st March 2006 BProject and BPackage Represent BlueJ’s view of projects and packages As with BlueJ itself, most of the action is in packages Through BPackage, you can retrieve, create and delete new classes and objects, including BlueJ’s representations of them

9 First BlueJ Day, Houston, Texas, 1st March 2006 BClass, BObject, BMethod, etc. Manipulate BlueJ’s set of classes and objects Invoke methods (and constructors) and place the resulting objects on the bench Designed to look like Java reflection, and backed up by real reflection (but watch out for side effects when using real reflection)

10 First BlueJ Day, Houston, Texas, 1st March 2006 Watching what users are doing Using a standard listener mechanism, an extension can find out when: –packages are opened or closed –classes are compiled (and what happened) –objects are invoked

11 First BlueJ Day, Houston, Texas, 1st March 2006 Interacting with the Editor Many possible extensions want more interaction with the user during code creation We provide an interface to the BlueJ editor for a class, for manipulating text A “property” mechanism allows an extension to interact with a modified editor for more detailed interaction

12 First BlueJ Day, Houston, Texas, 1st March 2006 More information The Extensions API documentation, and an example, are at: If you want to get involved in an existing extension, consider the Project Exporter at: bluej-project-exporter.dev.java.net Remember: BlueJ extensions make great student projects!