Griffon: Swing just got fun again

2,286 views

Published on

Slides from session at SVCC '09

Published in: Technology, Lifestyle
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
2,286
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
22
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Griffon: Swing just got fun again

  1. 1. Griffon: Swing just got fun again James Williams
  2. 2. Agenda <ul><ul><li>What is Griffon? </li></ul></ul><ul><ul><li>What's un-fun about Swing? </li></ul></ul><ul><ul><li>Getting Started </li></ul></ul><ul><ul><li>Builders </li></ul></ul><ul><ul><li>Griffon MVC </li></ul></ul><ul><ul><li>Lifecycle </li></ul></ul><ul><ul><li>Add-ons </li></ul></ul><ul><ul><li>Plugins </li></ul></ul><ul><ul><li>Demos </li></ul></ul><ul><ul><li>QA </li></ul></ul>
  3. 3. What's un-fun about Swing?
  4. 4. What's un-fun about Swing? <ul><ul><li>not knowing where stuff is </li></ul></ul><ul><ul><li>old school Swing is repetitive </li></ul></ul><ul><ul><li>unresponsive user interfaces </li></ul></ul><ul><ul><li>configuring JNLPs is a nightmare </li></ul></ul><ul><ul><li>signing jars is a pain </li></ul></ul><ul><ul><li>you have to choose between applets and desktop pretty early  </li></ul></ul><ul><li>     </li></ul>
  5. 5. What is Griffon? <ul><ul><li>desktop framework leveraging Swing and Groovy </li></ul></ul><ul><ul><li>Apache 2 Licensed </li></ul></ul><ul><ul><li>very extensible </li></ul></ul><ul><ul><li>unofficially called &quot;Grails for the desktop&quot; </li></ul></ul>
  6. 6. Griffon Application Structure
  7. 7. Getting Started <ul><ul><li>griffon create-app <AppName> </li></ul></ul><ul><ul><li>griffon list-plugins  </li></ul></ul><ul><ul><li>griffon install-plugin <PluginName> </li></ul></ul><ul><ul><li>griffon run-app </li></ul></ul><ul><ul><li>griffon run-applet </li></ul></ul><ul><ul><li>griffon run-webstart </li></ul></ul><ul><ul><li>griffon package </li></ul></ul>
  8. 8. Builders <ul><ul><li>DSLs to compose complex structures </li></ul></ul><ul><ul><li>Encapsulate some common conversions  </li></ul></ul><ul><ul><li>Can allow elements from different toolkits to be mixed </li></ul></ul><ul><ul><li>Yield much more readable code than typical Java code </li></ul></ul>
  9. 9. Builders - Sample Code <ul><li>JFrame frame = new JFrame(&quot;My Frame&quot;); </li></ul><ul><li>frame.setSize(200,200); </li></ul><ul><li>frame.add(new JLabel(&quot;Test Label&quot;)); </li></ul><ul><li>is the equivalent to : </li></ul><ul><li>frame (title: &quot;My Frame&quot;, size:[200,200]) { </li></ul><ul><li>     label(&quot;Test Label&quot;) </li></ul><ul><li>} </li></ul>
  10. 10. Models <ul><ul><li>contain variables referenced by the controller and view </li></ul></ul><ul><ul><li>can use the @Bindable notation to provide binding support </li></ul></ul><ul><ul><li>  are injected into the controller and view at run-time </li></ul></ul>
  11. 11. Views <ul><ul><li>can be written in Groovy or Java </li></ul></ul><ul><ul><li>represent a single display in your application </li></ul></ul><ul><ul><li>can mix and match components from different UI toolkits </li></ul></ul>
  12. 12. Demo - Simple Calculator
  13. 13. Griffon Lifecycle <ul><ul><li>Initialize </li></ul></ul><ul><ul><ul><li>  run before any Swing code is started </li></ul></ul></ul><ul><ul><li>Startup </li></ul></ul><ul><ul><ul><li>  run after MVC Groups are initialized </li></ul></ul></ul><ul><ul><li>Ready </li></ul></ul><ul><ul><ul><li>  all events have been processed by the EDT </li></ul></ul></ul><ul><ul><li>Shutdown </li></ul></ul><ul><ul><ul><li>all cleanup operations go here </li></ul></ul></ul>
  14. 14. UI Threading aka &quot;The Evil EDT&quot; <ul><ul><li>doOutside </li></ul></ul><ul><ul><li>doInside </li></ul></ul><ul><ul><li>doLater </li></ul></ul><ul><ul><li>edt </li></ul></ul>
  15. 15. Add-ons <ul><ul><li>run-time analog to plugins </li></ul></ul><ul><ul><li>can add or respond to runtime events </li></ul></ul><ul><ul><li>can decorate MVC Groups </li></ul></ul>
  16. 16. Plugin Types <ul><ul><li>User Interface Builders </li></ul></ul><ul><ul><li>Testing </li></ul></ul><ul><ul><li>Other JVM Langs </li></ul></ul><ul><ul><li>Bling </li></ul></ul><ul><ul><li>Database </li></ul></ul><ul><ul><li>Miscellaneous </li></ul></ul>
  17. 17. User Interface Builder Plugins <ul><ul><li>AbeilleFormBuilder </li></ul></ul><ul><ul><li>CSSBuilder </li></ul></ul><ul><ul><li>FlamingoBuilder </li></ul></ul><ul><ul><li>FxBuilder </li></ul></ul><ul><ul><li>GfxBuilder </li></ul></ul><ul><ul><li>JIDEBuilder </li></ul></ul><ul><ul><li>MacWidgetsBuilder </li></ul></ul><ul><ul><li>SwingXBuilder </li></ul></ul><ul><ul><li>SwingXtrasBuilder </li></ul></ul><ul><ul><li>TrayBuilder </li></ul></ul><ul><ul><li>TridentBuilder </li></ul></ul>
  18. 18. Testing Plugins <ul><ul><li>Code coverage </li></ul></ul><ul><ul><li>CodeNarc </li></ul></ul><ul><ul><li>EasyB </li></ul></ul><ul><ul><li>Fest </li></ul></ul><ul><ul><li>JDepend </li></ul></ul>
  19. 19. JVM Language Plugins <ul><ul><li>LangBridge </li></ul></ul><ul><ul><li>Clojure </li></ul></ul><ul><ul><li>Scala </li></ul></ul>
  20. 20. Bling Plugins <ul><ul><li>JGoodiesForms </li></ul></ul><ul><ul><li>Splash Screen </li></ul></ul><ul><ul><li>Transitions </li></ul></ul>
  21. 21. Miscellaneous Plugins <ul><ul><li>GPars </li></ul></ul><ul><ul><li>Installer </li></ul></ul><ul><ul><li>JUNG </li></ul></ul><ul><ul><li>Wizard </li></ul></ul>
  22. 22. Demo - SwingPad
  23. 23. Demo - Griffon on Wave
  24. 24. Griffon Links <ul><li>Download: http://griffon.codehaus.org (includes Greet) </li></ul><ul><li>Gr8Forums: http://bit.ly/Griffon-on-GR8Forum </li></ul><ul><li>Demos (except Greet):  http://github.com/jwill/griffon-testing-grounds/ </li></ul>
  25. 25. Griffon Team on Twitter <ul><ul><li>@ecspike - James Williams (Me) </li></ul></ul><ul><ul><li>@shemnon - Danno Ferrin </li></ul></ul><ul><ul><li>@aalmiray - Andres Almiray </li></ul></ul><ul><ul><li>@joshareed - Josh Reed </li></ul></ul><ul><ul><li>@jshingler - Jim Shingler </li></ul></ul>

×