griffon: swing just got fun again
TRANSCRIPT
Agenda
• What is Griffon?• What's un-fun about Swing?• Getting Started• Builders• Griffon MVC• Lifecycle• Add-ons• Plugins• Demos• QA
What's un-fun about Swing?
• not knowing where stuff is
• old school Swing is repetitive
• unresponsive user interfaces
• configuring JNLPs is a nightmare
• signing jars is a pain
• you have to choose between applets and desktop pretty early
What is Griffon?
• desktop framework leveraging Swing and Groovy
• Apache 2 Licensed
• very extensible
• unofficially called "Grails for the desktop"
Getting Started
• griffon create-app <AppName>
• griffon list-plugins
• griffon install-plugin <PluginName>
• griffon run-app
• griffon run-applet
• griffon run-webstart
• griffon package
Builders
• DSLs to compose complex structures
• Encapsulate some common conversions
• Can allow elements from different toolkits to be mixed
• Yield much more readable code than typical Java code
Builders - Sample Code
JFrame frame = new JFrame("My Frame");frame.setSize(200,200);frame.add(new JLabel("Test Label"));
is the equivalent to :
frame (title: "My Frame", size:[200,200]) { label("Test Label")}
Models
• contain variables referenced by the controller and view
• can use the @Bindable notation to provide binding support
• are injected into the controller and view at run-time
Views
• can be written in Groovy or Java
• represent a single display in your application
• can mix and match components from different UI toolkits
Griffon Lifecycle
• Initializeo run before any Swing code is started
• Startupo run after MVC Groups are initialized
• Readyo all events have been processed by the EDT
• Shutdowno all cleanup operations go here
Add-ons
• run-time analog to plugins
• can add or respond to runtime events
• can decorate MVC Groups
Plugin Types
• User Interface Builders
• Testing
• Other JVM Langs
• Bling
• Database
• Miscellaneous
User Interface Builder Plugins
• AbeilleFormBuilder• CSSBuilder• FlamingoBuilder• FxBuilder• GfxBuilder• JIDEBuilder• MacWidgetsBuilder• SwingXBuilder• SwingXtrasBuilder• TrayBuilder• TridentBuilder
Griffon Links
Download: http://griffon.codehaus.org (includes Greet)
Gr8Forums: http://bit.ly/Griffon-on-GR8Forum
Demos (except Greet): http://github.com/jwill/griffon-testing-grounds/