Transcript Document

BlueJScript @ the
First BlueJ Day
Houston, 2006
Matthew C. Jadud
University of Kent
Outline
•
•
•
•
•
What is it?
Demo: Purple Cow
“Hello World”
Wherefore BlueJScript?
Demo: Trails
First BlueJ Day, Houston, Texas, 1st March 2006
2
What is BlueJScript?
• It’s just Javascript…
– With privileges!
• What can it do?
– Full access to extensions API
– Full access to standard Java
libraries (java.*, javax.*)
• BlueJ überscripting environment
First BlueJ Day, Houston, Texas, 1st March 2006
3
Demo: Purple Cow
First BlueJ Day, Houston, Texas, 1st March 2006
4
“Hello World”
• In the project folder:
– extensions/bluejscript.jar
– profile.js
• What do these do?
– Without the BlueJScript extension,
there is no BlueJScript
– The profile.js is where the magic
happens
First BlueJ Day, Houston, Texas, 1st March 2006
5
A simple profile.js
• A “hello, world” if you will
– Shows the BlueJScript console
– Prints something to it
• This is the BlueJ project I’ve
called “SimpleProfile”
First BlueJ Day, Houston, Texas, 1st March 2006
6
A less simple profile.js
• You’ll probably find yourself
listening to BlueJ events a lot
• This BlueJScript application:
– Listens for any events from BlueJ
– Prints out their name
• This is the BlueJ project I’ve
called “WatchingEvents”
First BlueJ Day, Houston, Texas, 1st March 2006
7
What you get
• You have the full extensions API
(effectively bluej.*)
• BlueJScript provided support
classes (the jsConsole, htmlPane,
event handling…)
• All of java.*, javax.*
First BlueJ Day, Houston, Texas, 1st March 2006
8
Start brainstorming…
• You have full access to all of the
Java class libraries from a
dynamic scripting language!
• In NetDemo, I grab data from
external sources
• In SwingDemo, I illustrate what
might be a BlueJ bug, or
BlueJScript worst-practice…
First BlueJ Day, Houston, Texas, 1st March 2006
9
Wherefore?
• Low cost of entry
– Neat things can be done simply as
BlueJScript extensions
• Full access to BlueJ
– We can inspect classes and objects
– Create objects, invoke methods
– Windows, dialogs, etc…
First BlueJ Day, Houston, Texas, 1st March 2006
10
Take over world, contd.
• Functional, dynamic language for
driving BlueJ
• Treat BlueJ, Java libs as a “rich
API” for creating interactive
instructional applications
• Easy, lightweight deployment
option for interacting with
student code
First BlueJ Day, Houston, Texas, 1st March 2006
11
Demo: Trails
• Provide scaffolding for adult
learners tackling Java in a
condensed course of study
• Tackle syntax and semantics at a
finer grain than Objects First
• Represents a starting point for a
class of applications, not an
endpoint
First BlueJ Day, Houston, Texas, 1st March 2006
12
More questions?
• bluej.org (Documentation)
• bluej-discuss (mailing list)
• [email protected]
– Consider the list first…
First BlueJ Day, Houston, Texas, 1st March 2006
13