Submit Search
Upload
GR8Conf 2009: Griffon by Jim Shingler
â¢
3 likes
â¢
791 views
GR8Conf
Follow
Jim Shingler presents an introduction to the Griffon Swing MVC framework.
Read less
Read more
Business
Technology
Report
Share
Report
Share
1 of 50
Download now
Download to read offline
Recommended
What have you learnt from technologies from the process of construction the p...
What have you learnt from technologies from the process of construction the p...
JackSandham
Â
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf
Â
GR8Conf 2011: Building Progressive UIs with Grails
GR8Conf 2011: Building Progressive UIs with Grails
GR8Conf
Â
GR8Conf 2011: Groovy 1.8 update
GR8Conf 2011: Groovy 1.8 update
GR8Conf
Â
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf
Â
GR8Conf 2011: Canoo RIA Suite
GR8Conf 2011: Canoo RIA Suite
GR8Conf
Â
Grails EE
Grails EE
GR8Conf
Â
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Martin Meijer
Â
Recommended
What have you learnt from technologies from the process of construction the p...
What have you learnt from technologies from the process of construction the p...
JackSandham
Â
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf
Â
GR8Conf 2011: Building Progressive UIs with Grails
GR8Conf 2011: Building Progressive UIs with Grails
GR8Conf
Â
GR8Conf 2011: Groovy 1.8 update
GR8Conf 2011: Groovy 1.8 update
GR8Conf
Â
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf
Â
GR8Conf 2011: Canoo RIA Suite
GR8Conf 2011: Canoo RIA Suite
GR8Conf
Â
Grails EE
Grails EE
GR8Conf
Â
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Presentation BP205 "Custom Controls: Powerful, But Not Rocket Science!" Conne...
Martin Meijer
Â
Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7
Gary Park
Â
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
AgileSparks
Â
BP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOU
Mat Newman
Â
JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)
Graeme_IBM
Â
Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4
360|Conferences
Â
Prince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners Handout
Eelco Gravendeel
Â
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
Ryan Sciampacone
Â
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CD
Rakuten Group, Inc.
Â
Evaluation Q6.
Evaluation Q6.
samwadsted
Â
Scrum Out Of The Nutshell
Scrum Out Of The Nutshell
DougShimp
Â
Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3
Doug Shimp
Â
Agile is the New Black
Agile is the New Black
Fred George
Â
Griffon demo
Griffon demo
James Kirkbride
Â
Ci Presentation for SPIN
Ci Presentation for SPIN
OpenSource Connections
Â
Image Principles.pptx
Image Principles.pptx
LeoOrtega19
Â
Zimbra scripting with python
Zimbra scripting with python
Imam Omar Mochtar
Â
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon Berlin
Â
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Luca Milanesio
Â
DevOps Enabling Your Team
DevOps Enabling Your Team
GR8Conf
Â
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
GR8Conf
Â
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
GR8Conf
Â
Metaprogramming with Groovy
Metaprogramming with Groovy
GR8Conf
Â
More Related Content
Similar to GR8Conf 2009: Griffon by Jim Shingler
Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7
Gary Park
Â
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
AgileSparks
Â
BP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOU
Mat Newman
Â
JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)
Graeme_IBM
Â
Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4
360|Conferences
Â
Prince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners Handout
Eelco Gravendeel
Â
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
Ryan Sciampacone
Â
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CD
Rakuten Group, Inc.
Â
Evaluation Q6.
Evaluation Q6.
samwadsted
Â
Scrum Out Of The Nutshell
Scrum Out Of The Nutshell
DougShimp
Â
Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3
Doug Shimp
Â
Agile is the New Black
Agile is the New Black
Fred George
Â
Griffon demo
Griffon demo
James Kirkbride
Â
Ci Presentation for SPIN
Ci Presentation for SPIN
OpenSource Connections
Â
Image Principles.pptx
Image Principles.pptx
LeoOrtega19
Â
Zimbra scripting with python
Zimbra scripting with python
Imam Omar Mochtar
Â
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon Berlin
Â
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Luca Milanesio
Â
Similar to GR8Conf 2009: Griffon by Jim Shingler
(18)
Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7
Â
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Â
BP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOU
Â
JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)
Â
Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4
Â
Prince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners Handout
Â
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
Â
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CD
Â
Evaluation Q6.
Evaluation Q6.
Â
Scrum Out Of The Nutshell
Scrum Out Of The Nutshell
Â
Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3
Â
Agile is the New Black
Agile is the New Black
Â
Griffon demo
Griffon demo
Â
Ci Presentation for SPIN
Ci Presentation for SPIN
Â
Image Principles.pptx
Image Principles.pptx
Â
Zimbra scripting with python
Zimbra scripting with python
Â
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Â
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Â
More from GR8Conf
DevOps Enabling Your Team
DevOps Enabling Your Team
GR8Conf
Â
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
GR8Conf
Â
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
GR8Conf
Â
Metaprogramming with Groovy
Metaprogramming with Groovy
GR8Conf
Â
Scraping with Geb
Scraping with Geb
GR8Conf
Â
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
GR8Conf
Â
Ratpack On the Docks
Ratpack On the Docks
GR8Conf
Â
Groovy Powered Clean Code
Groovy Powered Clean Code
GR8Conf
Â
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
GR8Conf
Â
Performance tuning Grails applications
Performance tuning Grails applications
GR8Conf
Â
Ratpack and Grails 3
Ratpack and Grails 3
GR8Conf
Â
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
GR8Conf
Â
Functional testing your Grails app with GEB
Functional testing your Grails app with GEB
GR8Conf
Â
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
GR8Conf
Â
The Grails introduction workshop
The Grails introduction workshop
GR8Conf
Â
Idiomatic spock
Idiomatic spock
GR8Conf
Â
The Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
GR8Conf
Â
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
GR8Conf
Â
Integration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
GR8Conf
Â
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
GR8Conf
Â
More from GR8Conf
(20)
DevOps Enabling Your Team
DevOps Enabling Your Team
Â
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
Â
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
Â
Metaprogramming with Groovy
Metaprogramming with Groovy
Â
Scraping with Geb
Scraping with Geb
Â
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
Â
Ratpack On the Docks
Ratpack On the Docks
Â
Groovy Powered Clean Code
Groovy Powered Clean Code
Â
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
Â
Performance tuning Grails applications
Performance tuning Grails applications
Â
Ratpack and Grails 3
Ratpack and Grails 3
Â
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
Â
Functional testing your Grails app with GEB
Functional testing your Grails app with GEB
Â
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
Â
The Grails introduction workshop
The Grails introduction workshop
Â
Idiomatic spock
Idiomatic spock
Â
The Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
Â
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
Â
Integration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
Â
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
Â
Recently uploaded
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
ashishs7044
Â
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
MarkAnthonyAurellano
Â
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
ashishs7044
Â
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
richard876048
Â
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
dollysharma2066
Â
IoT Insurance Observatory: summary 2024
IoT Insurance Observatory: summary 2024
Matteo Carbone
Â
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
ictsugar
Â
Call Us ð²8800102216ð Call Girls In DLF City Gurgaon
Call Us ð²8800102216ð Call Girls In DLF City Gurgaon
callgirls2057
Â
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted Version
Mintel Group
Â
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
Seta Wicaksana
Â
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
Data Analytics Company - 47Billion Inc.
Â
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
HajeJanKamps
Â
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
Mintel Group
Â
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
ashishs7044
Â
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
Neil Kimberley
Â
PSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
Anamaria Contreras
Â
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
ssuserf63bd7
Â
Kenyaâs Coconut Value Chain by Gatsby Africa
Kenyaâs Coconut Value Chain by Gatsby Africa
ictsugar
Â
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
ictsugar
Â
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
ShrutiBose4
Â
Recently uploaded
(20)
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
Â
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Â
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
Â
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
Â
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Â
IoT Insurance Observatory: summary 2024
IoT Insurance Observatory: summary 2024
Â
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Â
Call Us ð²8800102216ð Call Girls In DLF City Gurgaon
Call Us ð²8800102216ð Call Girls In DLF City Gurgaon
Â
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted Version
Â
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
Â
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
Â
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Â
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
Â
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
Â
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
Â
PSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
Â
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
Â
Kenyaâs Coconut Value Chain by Gatsby Africa
Kenyaâs Coconut Value Chain by Gatsby Africa
Â
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
Â
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Â
GR8Conf 2009: Griffon by Jim Shingler
1.
Introduction to
Creating a Griffon: Rich Client front-end to our Twitter Clone By Jim Shingler © Jim Shingler Wednesday, May 13, 2009 1
2.
Abstract
Groovy and Grails have given us the ability to leverage the strength of the Java Platform (and Eco System) and the productivity of âConvention over Conï¬gurationâ to construct websites. But âWhat Ifâ the User Interface requirements of the new application is best solved with the type of interaction a desktop application provides? Griffon bring the same productivity gains to the desktop application that Grails brings to web applications. This session will use Griffon and popular open source libraries to build a desktop application to interact with a Grails backend. © Jim Shingler Wednesday, May 13, 2009 2
3.
Introduction
My name is Jim Shingler Chief Technical Architect President of Genuine Solutions Beginning Groovy and Grails Co-Author FallME (Inversion of Control for JavaME) Co-Founder Griffon Splash Plugin Author Griffon gConï¬g Author Griffon TM Bundle Author © Jim Shingler Wednesday, May 13, 2009 3
4.
Agenda
Griffon 101 â¢What is Griffon â¢Installing Griffon â¢0 -100 k/mph in 60 seconds </xml> â¢Plugins Overview â¢Teaching the Griffon to count (Binding and Threading) â¢Readying Graemeâs Twitter Clone Griffon 201 â¢Griffon Twitter Client © Jim Shingler Wednesday, May 13, 2009 4
5.
Installing Griffon
1. Download Griffon 2. Unpack it (unix: /opt/local/share/ windows: /apps/griffon) 3. Set the GROOVY_HOME 4. Add it to your path, <GROOVY_HOME>/bin © Jim Shingler Wednesday, May 13, 2009 5
6.
0-100 k/mph
in 60 Seconds > griffon create-app small Welcome to Griffon 0.1.0 - http://griffon.codehaus.org/ Licensed under Apache Standard License 2.0 Griffon home is set to: /opt/local/share/griffon-0.1.0 ... > griffon run-app © Jim Shingler Wednesday, May 13, 2009 6
7.
DEMO
© Jim Shingler Wednesday, May 13, 2009 7
8.
Congratulations
you are a Developer © Jim Shingler Wednesday, May 13, 2009 8
9.
Donât
forget to update your resume. Griffon © Jim Shingler Wednesday, May 13, 2009 9
10.
App Structure
& Convention A pretty standard application structure, . . . you can pretty well guess the purpose of the ï¬les and directories. © Jim Shingler Wednesday, May 13, 2009 10
11.
Griffon Commands
© Jim Shingler Wednesday, May 13, 2009 11
12.
Plugins
© Jim Shingler Wednesday, May 13, 2009 12
13.
Start Small
⢠Swing and SwingX Builder ⢠GUI Components ⢠About Box ⢠Deï¬ne and Process Actions © Jim Shingler Wednesday, May 13, 2009 13
14.
DEMO
⢠Create Count App ⢠Add Button ⢠Build and Initialize âClick Actionâ ⢠Process the Click Action ⢠Install and Enable SwingXBuilder ⢠Build and Initialize Menus ⢠Build and Initialize âMenu Actionsâ ⢠Process the Menu Actions © Jim Shingler Wednesday, May 13, 2009 14
15.
Controller
import javax.swing.JOptionPane class CountingController { // these will be injected by Griffon def model def view def builder void mvcGroupInit(Map args) { // this method is called after model and view are injected } def click = { evt = null -> model.count++ } def exit = { evt = null -> app.shutdown() } def showAbout = { evt = null -> builder.optionPane().showMessageDialog(null, 'This is the Counting Application') } } © Jim Shingler Wednesday, May 13, 2009 15
16.
Model
import groovy.beans.Bindable Adds Property @Bindable Change Support class CountingModel { def count = 0 } to the model © Jim Shingler Wednesday, May 13, 2009 16
17.
View and Menu
View application(title:'sample2', /*size:[320,480], */location:[200,200], pack:true, locationByPlatform:false) { // add content here build(Actions) Loads and runs Actions and MenuBar scripts inline build(MenuBar) button(id:'clickButton', text:bind{ model.count }, action: clickAction) } Data Binding. Observe the change in the model MenuBar Execute the âclickActionâ jxmenuBar { menu(text: 'File', mnemonic: 'F') { menuItem(exitAction) Use the action to deï¬ne } the menu item glue() menu(text: 'Help', mnemonic: 'H') { menuItem(aboutAction) } } © Jim Shingler Wednesday, May 13, 2009 17
18.
Actions
// create the actions Closure to run when action(id: 'clickAction', the action is name: 'Click Me', executed closure: controller.&click, shortDescription: 'Increment the Click Count' ) action(id: 'exitAction', name: 'Exit', closure: controller.exit, mnemonic: 'x', accelerator: 'F4', shortDescription: 'Exit SimpleUI' ) action(id: 'aboutAction', name: 'About', closure: controller.showAbout, mnemonic: 'A', accelerator: 'F1', shortDescription: 'Find out about SimpleUI' ) © Jim Shingler Wednesday, May 13, 2009 18
19.
Threading the GUI
It isnât that bad © Jim Shingler Wednesday, May 13, 2009 19
20.
Rules of Thumb
⢠Painting and UI Operations need to be done in the EventDispatchThread (EDT) ⢠Everything else should be done outside the EDT ⢠Java 6 has SwingWorker, Java 5 has SwingLabs Swingworker But that just isnât Groovy enough for Griffon © Jim Shingler Wednesday, May 13, 2009 20
21.
Griffon Threading
⢠Build the UI in the EDT SwingBuilder.build { . . . } ⢠Long Running code outside the EDT doOutside { . . . } Creates thread and runs closure ⢠code inside the EDT edt { . . . } Do synchronously in EDT doLater { . . . } Do asynchronously in EDT © Jim Shingler Wednesday, May 13, 2009 21
22.
DEMO
© Jim Shingler Wednesday, May 13, 2009 22
23.
Model
import groovy.beans.Bindable @Bindable class CountingModel { def count = 0 def countSlow = 0 def countConcurrent = 0 } © Jim Shingler Wednesday, May 13, 2009 23
24.
View
application(title:'counting', /*size:[320,480], location:[50,50],*/ pack:true, locationByPlatform:true) { build(Actions) build(MenuBar) gridLayout() button(id:'clickButton', text:bind {model.count}, action: clickAction) label(text:bind {model.count}) button(id:'slowClickButton', text:"Slow Click", action: slowClickAction) label(text:bind {model.countSlow}) button(id:'concurrentClickButton', text:"Concurrent Click", action: concurrentClickAction) label(text:bind {model.countConcurrent}) } © Jim Shingler Wednesday, May 13, 2009 24
25.
Actions
// create the actions action(id: 'clickAction', name: 'Click', closure: controller.&click, shortDescription: 'Increment the Click Count' ) action(id: 'clickActionSlow', name: 'Click Slow', closure: controller.&clickSlow, shortDescription: 'Increment the Click Count Slow' ) action(id: 'clickActionConcurrent', name: 'Click Concurrent', closure: controller.&clickConcurrent, shortDescription: 'Increment the Click Count Concurrent' ) action(id: 'exitAction', name: 'Exit', closure: controller.exit, mnemonic: 'x', accelerator: 'F4', shortDescription: 'Exit SimpleUI' ) action(id: 'aboutAction', name: 'About', closure: controller.showAbout, mnemonic: 'A', accelerator: 'F1', shortDescription: 'Find out about SimpleUI' ) © Jim Shingler Wednesday, May 13, 2009 25
26.
Controller
import javax.swing.JOptionPane class CountingController { // these will be injected by Griffon def model def view void mvcGroupInit(Map args) { } def click = { evt -> model.count++ } def clickSlow = { evt = null -> Thread.sleep(5000) model.countSlow++ } def clickConcurrent = { evt = null -> doOutside { Thread.sleep(5000) edt { // Sync model.countConcurrent++ } } } def exit = { evt = null -> System.exit(0) } def showAbout = { evt = null -> JOptionPane.showMessageDialog(null, '''This is the SimpleUI Application''') } } © Jim Shingler Wednesday, May 13, 2009 26
27.
Twitter Clone
Enhancements © Jim Shingler Wednesday, May 13, 2009 27
28.
Render Status XML
import grails.converters.* class StatusController { def twitterCache def index = { def messages = twitterCache.get(principalInfo.username)?.value if(!messages) { messages = findStatusMessages() twitterCache.put new Element(principalInfo.username, messages) } def feedOutput = { . . . } withFormat { html([messages:messages]) xml { render messages as XML} rss { render(feedType:"rss", feedOutput)} } } . . . © Jim Shingler Wednesday, May 13, 2009 28
29.
Render Person XML
import grails.converters.* class PersonController { ... def ï¬ndByUsername = { def p = Person.ï¬ndByUsername(params.username) withFormat { html person:p xml { render p as XML } } } ... © Jim Shingler Wednesday, May 13, 2009 29
30.
def show =
{ def person = Person.get(params.id) if (!person) { ï¬ash.message = "Person not found with id $params.id" redirect action: list return } List roleNames = [] for (role in person.authorities) { roleNames << role.authority } roleNames.sort { n1, n2 -> n1 <=> n2 } withFormat { html ( [person: person, roleNames: roleNames] ) xml { render person as XML } } // [person: person, roleNames: roleNames] } © Jim Shingler Wednesday, May 13, 2009 30
31.
Acegi Basic
Authentication grails-app/conf/SecurityConï¬g.groovy security { // see DefaultSecurityConfig.groovy for all settable/overridable properties active = true basicProcessingFilter = true loginUserDomainClass = "Person" authorityDomainClass = "Authority" requestMapClass = "Requestmap" } © Jim Shingler Wednesday, May 13, 2009 31
32.
Acegi Basic
Authentication grails-app/conf/spring/resources.groovy beans = { authenticationEntryPoint(org.springframework.security.ui.basicauth. BasicProcessingFilterEntryPoint) { realmName = 'Grails Realm' } twitterCache(org.springframework.cache.ehcache.EhCacheFactoryBean) { timeToLive = 1200 } } © Jim Shingler Wednesday, May 13, 2009 32
33.
Griffon Twitter
Clone Client © Jim Shingler Wednesday, May 13, 2009 33
34.
Requirements
⢠Login ⢠Display User Info ⢠Display Statuses (Tweets) ⢠Update Statuses(Tweets) ⢠Send My Own Status (Tweet) © Jim Shingler Wednesday, May 13, 2009 34
35.
Overview
MVC Triad MenuBar Controller View ToolBar StatusBar Model Tips About Twitter Service </xml> Twitter Clone © Jim Shingler Wednesday, May 13, 2009 35
36.
Letâs get to
Work © Jim Shingler Wednesday, May 13, 2009 36
37.
Login
Refresh ToolBar User Info Statuses / Tweets Update Status © Jim Shingler Wednesday, May 13, 2009 37
38.
© Jim Shingler Wednesday,
May 13, 2009 38
39.
Other Griffon
Apps © Jim Shingler Wednesday, May 13, 2009 39
40.
© Jim Shingler Wednesday,
May 13, 2009 40
41.
© Jim Shingler Wednesday,
May 13, 2009 41
42.
© Jim Shingler Wednesday,
May 13, 2009 42
43.
© Jim Shingler Wednesday,
May 13, 2009 43
44.
© Jim Shingler Wednesday,
May 13, 2009 44
45.
© Jim Shingler Wednesday,
May 13, 2009 45
46.
The Code
http://github.com/jshingler/gr8conf_2009/tree/master © Jim Shingler Wednesday, May 13, 2009 46
47.
Founders
Danno Ferrin http://shemnon.com/speling Andres Almiray http://jroller.com/aalmiray James Williams http://jameswilliams.be/blog © Jim Shingler Wednesday, May 13, 2009 47
48.
Resources
⢠Griffon ⢠griffon.codehause.org ⢠griffon-user@groovy.codehause.org ⢠Grails ⢠www.grails.org Coming ⢠Books Soon © Jim Shingler Wednesday, May 13, 2009 48
49.
Resources
⢠dev@griffon.codehaus.org is a medium volume list useful for those interested in ongoing developments ⢠scm@griffon.codehaus.org is a high volume list that logs commits and issues ⢠user@griffon.codehaus.org is a high volume list is for questions and general discussion about Griffon ⢠You can ï¬nd a great archive support at MarkMail, http://griffon.markmail.org. © Jim Shingler Wednesday, May 13, 2009 49
50.
Conclusion
Thank You for your time ⢠Blog: http://jshingler.blogspot.com ⢠Email: ShinglerJim@gmail.com ⢠LinkedIn: http://www.linkedin.com/in/jimshingler ⢠Twitter: @jshingler © Jim Shingler Wednesday, May 13, 2009 50
Download now