Post on 20-May-2015
description
Griffon... a Grails Developer’s Perspective
Swing + Groovy + Grails
Wait... Swing?
BORDER LAYOUT
BOX LAYOUT
CARD LAYOUT
FLOW LAYOUT
GRID LAYOUT
SPRING LAYOUT
BORDER LAYOUT
BOX LAYOUT
CARD LAYOUT
FLOW LAYOUT
GRID LAYOUT
SPRING LAYOUTEVEN
T MADNESS
THREA
DING HELL
GRIDBAGLAYOUT
GRIDBAGLAYOUT
MVC Triad
VIEW
MODEL
CONTROLLER
bindings
actions
bindings
swing
Bindings
Can bind view components to view components
Model properties can be @Bindable and available from Controller and View
Validation is available within bindings
bind ( source: c1, sourceProperty: ‘text’ target: c2, targetProperty: ‘text’ )
Binding example (view)
def counter = 0application(title:'bindfun', pack:true, locationByPlatform:true) { gridLayout( cols:1, rows:2) button("Click me", id:'b') label(id:'lbl', text: bind( source: b, sourceEvent: 'actionPerformed', sourceValue: { counter++ }, converter: { lbl.text + it} ) )}
MVC Groups
MVC pattern can have a very small footprint
Can be in lots of places
Griffon’s MVC groups allows easy creation and deletion of MVC pattern
griffon create-mvc to create skeleton
createMVCGroup() to instantiate in running app
Image Viewer Demo
Plugins
10+ available
griffon list-plugins
griffon install-plugin myPlugin
Just like Grails
Thoughts
Swing is painful
Griffon is good
Missing documentation (only 0.1)
Great potential for growth
I wish I had this 3 years ago!
Resources
http://griffon.codehaus.org
http://groovy.codehaus.org/Swing+Builder
http://docs.codehaus.org/display/GRIFFON/FileViewer