SlideShare una empresa de Scribd logo
1 de 56
Descargar para leer sin conexión
Griffon
                G*



2011   9   23
id:kiy0taka @kiy0taka

                JGGUG

                G*Magazine Griffon

                Griffon                 (?)


2011   9   23
create-command-alias
                $ griffon create-command-alias hoge 
                > test-app unit: foo.BarTests

                $ griffon hoge


                Grails
                                 Griffon

                                      (ry


2011   9   23
Griffon



                Grails




2011   9   23
Java
       package sample;                                                         contentPane.add(button);

       import   java.awt.Container;                                            setDefaultCloseOperation(EXIT_ON_CLOSE);
       import   java.awt.GridLayout;                                           pack();
       import   java.awt.event.ActionEvent;                                    setVisible(true);
       import   java.awt.event.ActionListener;                             }

       import   javax.swing.JButton;                                       public static void main(String[] args) {
       import   javax.swing.JFrame;                                            SwingUtilities.invokeLater(new Runnable() {
       import   javax.swing.JLabel;                                                public void run() {
       import   javax.swing.JTextArea;                                                 new Hello();
       import   javax.swing.SwingUtilities;                                        }
                                                                               });
       public class Hello extends JFrame {                                 }
                                                                       }
            public Hello() {
                super("Hello");

                 Container contentPane = getContentPane();
                 contentPane.setLayout(new GridLayout(3, 1));

                 JLabel label = new JLabel("Label");
                 contentPane.add(label);

                 JTextArea textArea = new JTextArea("Text Area");
                 textArea.setColumns(20);
                 textArea.setRows(2);
                 contentPane.add(textArea);

                 JButton button = new JButton("Button");
                 button.addActionListener(new ActionListener() {
                     public void actionPerformed(ActionEvent evt) {

                       }
                 });



2011   9   23
Groovy
                import groovy.swing.SwingBuilder

                new SwingBuilder().edt {
                    frame(title:'Hello', show:true, pack:true) {
                        gridLayout(cols:1, rows:3)
                        label 'Label'
                        textArea('Text Area', rows:2, columns:20)
                        button('Button', actionPerformed:{ evt ->
                            ...
                        })
                    }
                }




2011   9   23
Java

            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ...
                }
            });

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    ...
                }
            });



2011   9   23
&

                export GRIFFON_HOME=/path/to/griffon

                export PATH=$GRIFFON_HOME/bin:$PATH




2011   9   23
griffon            [   ]

                griffon create-app myApp

                griffon run-app

                griffon test-app

                griffon package



2011   9   23
Grails


2011   9   23
Griffon Wrapper

                griffonw / griffonw.bat

                Griffon



                gradlew

                CI



2011   9   23
View




2011   9   23
View



                SwingBuilder




2011   9   23
SwingBuilder

                groovy.swing.SwingBuilder

                Groovy

                javax.swing.JXxx -> xxx()

                  JButton -> button()

                  JLabel -> label()



2011   9   23
View

                application(title:'Sample', pack:true, ...) {
                    tableLayout {
                        tr {
                             td { label('User Name') }
                             td { textField(columns:20) }
                        }
                        tr {
                             td { label('Password') }
                             td { passwordField(columns:20) }
                        }
                        tr {
                             td(colspan:2, align:'right') { button('Submit') }
                        }
                    }
                }




2011   9   23
View
                // MyMenuBar.groovy
                menuBar {
                    menu('File') {
                        menuItem('Open')
                        menuItem('Save')
                    }
                }

                // MyAppView.groovy
                application(...) {
                    build(MyMenuBar)
                }

2011   9   23
View      Java
                // MyPanel.java
                class MyPanel extends JPanel {
                    ...
                }


                // MyAppView.groovy
                application(...) {
                    widget(new MyPanel())
                }


2011   9   23
SwingPad




2011   9   23
SwingPad




2011   9   23
View


                SwingPad




                GroovyConsole




2011   9   23
SwingBuilder
                View

                SwingPad




2011   9   23
generate-view-script


                NetBeans           View   Griffon

                NetBeans Griffon




2011   9   23
Model




2011   9   23
Model

                package sample

                class SampleModel {
                    String username
                    String password
                }




2011   9   23
View           Model

                Model   View




2011   9   23
Model
                 package sample

                 import groovy.beans.Bindable

                 class SampleModel {
                     @Bindable String username
                     @Bindable String password
                 }




2011   9   23
Model
                 package sample

                 import groovy.beans.Bindable

                 @Bindable
                 class SampleModel {
                     String username
                     String password
                 }




2011   9   23
View -> Model


  textField(text:bind(target:model, targetProperty:‘username’))

   textField(text:bind(target:model, ‘username’))




2011   9   23
Model -> View


  textField(text:bind(source:model, sourceProperty:‘username’))

   textField(text:bind(source:model, ‘username’))


   textField(text:bind { model.username })




2011   9   23
View -> View


           buttonGroup(id:'group1')
           radioButton(id:‘radio1’, ‘    ’, buttonGroup:group1)
           radioButton(id:‘radio2’, ‘      ’, buttonGroup:group1)
           textField(editable:bind(source:radio1,
               sourceEvent:‘itemStateChanged’,
               sourceValue:{radio1.selected}))




2011   9   23
// Model
           class Model {
               Date now = new Date()
           }

           // View
           label(text:bind(‘now’, source:model,
               converter:{it.format(‘yyyy-MM-dd’)}))




2011   9   23
// Model
           class Model {
               int num
           }

           // View
           textField(text:bind(‘num’, target:model,
               validator:{ it?.isInteger() }))




2011   9   23
constraints?
                class MyModel   {
                    @Bindable   String requiredText
                    @Bindable   String url
                    @Bindable   String email

                    static constraints = {
                        requiredText(blank:false)
                        url(url:true)
                        email(email:true)
                    }
                }

2011   9   23
Validation

                Grails         constraints Model

                model.validate()

                model.errors

                net.sourceforge.gvalidation.swing.ErrorMessagePanel




2011   9   23
ErrorMessagePanel

       // View
       widget(new ErrorMessagePanel(messageSource),
           errors: bind(source: model, 'errors'))




2011   9   23
Controller




2011   9   23
Controller

                class SampleController {
                    def model
                    def view

                    void mvcGroupInit(Map args) { ... }
                    void mvcGroupDestroy() { ... }

                    def fooAction = { evt -> ... }
                    def barAction = { evt -> ... }
                }




2011   9   23
View


           button(‘Click!’,
               actionPerformed:controller.fooAction)




2011   9   23
Model View

                Controller     Model

                             View




2011   9   23
Controller
                             ( < 0.9.2 )

                             0.9.2         UI




2011   9   23
@Threading


                griffon.transform.Threading




2011   9   23
class MyController {

                @Threading(Threading.Policy.INSIDE_UITHREAD_SYNC)
                def myAction = {
                }

           }




2011   9   23
Threading.Policy
                OUTSIDE_UITHREAD

                                        (   )

                INSIDE_UITHREAD_SYNC

                  UI

                INSIDE_UITHREAD_ASYNC

                  UI

                SKIP



2011   9   23
class MyController {

                def myAction = {
                    //
                    execSync {
                        //       UI
                        execOutside {
                            //
                        }
                    }
                }
           }


2011   9   23
exec

                execSync

                  UI

                execAsync

                  UI

                execOutside




2011   9   23
Java/Groovy/Griffon

                    Java         Groovy       Griffon

                new Thread()    doOutside   execOutside

                 invokeLater     doLater    execAsync

                invokeAndWait     edt        execSync


2011   9   23
MVC


                Model View   Controller

                MVC

                  griffon create-mvc myNewGroup




2011   9   23
create-mvc

                -skip(View|Model|Controller)

                  View/Model/Controller        MVC

                -fileType=(groovy|java|etc)

                  Java




2011   9   23
createMvcGroup


                    MVC

                createMvcGroup(groupType, groupName, args)




2011   9   23
MVC

                SplitPane            MVC

                TabbedPane         MVC




                View         MVC



2011   9   23
Group1

           // View
           button('Add tab', actionPerformed:controller.addTab)
           tabbedPane id: 'tabGroup'

           // Controller
           def addTab = {
             def name = new Date().format('yyyy-MM-dd HH:mm:ss')
             createMVCGroup("tab", name
               [tabGroup: view.tabGroup, tabName: name])
           }




2011   9   23
Group2


           // View
           tabbedPane(tabGroup, selectedIndex:tabGroup.tabCount) {
              panel(title: tabName) {
                   label(tabName)
              }
           }




2011   9   23
Spock + FEST




2011   9   23
Spock + FEST
           class CalcSpec extends FestSpec {
               def 'my first FEST spec'() {
                   when:
                   window.textBox('arg1').enterText(arg1)
                   window.textBox('arg2').enterText(arg2)
                   window.button('calculate').click()

                    then:
                    window.label('result').requireText(result)

                    where:
                    arg1 | arg2 | result
                    '1' | '1' | '2'
                    '1' | '2' | '3'
                }
           }
2011   9   23
WebStart/Applet/Jar/Zip



                  griffon package [webstart|applet|jar|zip]



                  izpack|mac|rpm|deb|jsmooth


2011   9   23
0.9.3




                Griffon

                          0.9.3



2011   9   23

Más contenido relacionado

La actualidad más candente

Testing Android apps based on Dagger and RxJava Droidcon UK
Testing Android apps based on Dagger and RxJava Droidcon UKTesting Android apps based on Dagger and RxJava Droidcon UK
Testing Android apps based on Dagger and RxJava Droidcon UKFabio Collini
 
5 Favorite Gems (Lightning Talk(
5 Favorite Gems (Lightning Talk(5 Favorite Gems (Lightning Talk(
5 Favorite Gems (Lightning Talk(Mark
 
Say Hello To Ecmascript 5
Say Hello To Ecmascript 5Say Hello To Ecmascript 5
Say Hello To Ecmascript 5Juriy Zaytsev
 
How do we use hooks
How do we use hooksHow do we use hooks
How do we use hooksJim Liu
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2PRN USM
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbroncymbron
 
Scala101, first steps with Scala
Scala101, first steps with ScalaScala101, first steps with Scala
Scala101, first steps with ScalaGiampaolo Trapasso
 
Swiss army knife Spring
Swiss army knife SpringSwiss army knife Spring
Swiss army knife SpringMario Fusco
 
RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017Wanbok Choi
 
Refactoring group 1 - chapter 3,4,6
Refactoring   group 1 - chapter 3,4,6Refactoring   group 1 - chapter 3,4,6
Refactoring group 1 - chapter 3,4,6Duy Lâm
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScriptryanstout
 
Doc Parsers Api Cheatsheet 1 0
Doc Parsers Api Cheatsheet 1 0Doc Parsers Api Cheatsheet 1 0
Doc Parsers Api Cheatsheet 1 0Oleh Burkhay
 
LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기Wanbok Choi
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oopLearningTech
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"ZendCon
 

La actualidad más candente (20)

Testing Android apps based on Dagger and RxJava Droidcon UK
Testing Android apps based on Dagger and RxJava Droidcon UKTesting Android apps based on Dagger and RxJava Droidcon UK
Testing Android apps based on Dagger and RxJava Droidcon UK
 
5 Favorite Gems (Lightning Talk(
5 Favorite Gems (Lightning Talk(5 Favorite Gems (Lightning Talk(
5 Favorite Gems (Lightning Talk(
 
Quiniela
QuinielaQuiniela
Quiniela
 
Say Hello To Ecmascript 5
Say Hello To Ecmascript 5Say Hello To Ecmascript 5
Say Hello To Ecmascript 5
 
Graphical User Components Part 1
Graphical User Components Part 1Graphical User Components Part 1
Graphical User Components Part 1
 
How do we use hooks
How do we use hooksHow do we use hooks
How do we use hooks
 
Kotlin Generation
Kotlin GenerationKotlin Generation
Kotlin Generation
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
Scala101, first steps with Scala
Scala101, first steps with ScalaScala101, first steps with Scala
Scala101, first steps with Scala
 
Swiss army knife Spring
Swiss army knife SpringSwiss army knife Spring
Swiss army knife Spring
 
New text document
New text documentNew text document
New text document
 
RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017
 
Refactoring group 1 - chapter 3,4,6
Refactoring   group 1 - chapter 3,4,6Refactoring   group 1 - chapter 3,4,6
Refactoring group 1 - chapter 3,4,6
 
Swing
SwingSwing
Swing
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScript
 
Doc Parsers Api Cheatsheet 1 0
Doc Parsers Api Cheatsheet 1 0Doc Parsers Api Cheatsheet 1 0
Doc Parsers Api Cheatsheet 1 0
 
LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
 

Destacado

ミニ四駆ジャパンカップで勝つ方法を考える
ミニ四駆ジャパンカップで勝つ方法を考えるミニ四駆ジャパンカップで勝つ方法を考える
ミニ四駆ジャパンカップで勝つ方法を考えるKiyotaka Oku
 
GDK48総選挙の裏側
GDK48総選挙の裏側GDK48総選挙の裏側
GDK48総選挙の裏側Kiyotaka Oku
 
BaseScriptについて
BaseScriptについてBaseScriptについて
BaseScriptについてKiyotaka Oku
 
Jenkins plugin memo
Jenkins plugin memoJenkins plugin memo
Jenkins plugin memoKiyotaka Oku
 

Destacado (9)

Jenkins入門
Jenkins入門Jenkins入門
Jenkins入門
 
ミニ四駆ジャパンカップで勝つ方法を考える
ミニ四駆ジャパンカップで勝つ方法を考えるミニ四駆ジャパンカップで勝つ方法を考える
ミニ四駆ジャパンカップで勝つ方法を考える
 
JUC2012
JUC2012JUC2012
JUC2012
 
GDK48総選挙の裏側
GDK48総選挙の裏側GDK48総選挙の裏側
GDK48総選挙の裏側
 
Spockの基礎
Spockの基礎Spockの基礎
Spockの基礎
 
G * magazine 1
G * magazine 1G * magazine 1
G * magazine 1
 
javafx-mini4wd
javafx-mini4wdjavafx-mini4wd
javafx-mini4wd
 
BaseScriptについて
BaseScriptについてBaseScriptについて
BaseScriptについて
 
Jenkins plugin memo
Jenkins plugin memoJenkins plugin memo
Jenkins plugin memo
 

Similar a Griffon不定期便〜G*ワークショップ編〜

JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonEric Wendelin
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonMatthew McCullough
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdffathimaoptical
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
 
Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Kiyotaka Oku
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityNiraj Bharambe
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189Mahmoud Samir Fayed
 
Registro de venta
Registro de ventaRegistro de venta
Registro de ventalupe ga
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfvenkt12345
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、GaelykでハンズオンTsuyoshi Yamamoto
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 

Similar a Griffon不定期便〜G*ワークショップ編〜 (20)

JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
662305 11
662305 11662305 11
662305 11
 
Action bar
Action barAction bar
Action bar
 
Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196
 
The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Chap1 1.4
Chap1 1.4Chap1 1.4
Chap1 1.4
 

Más de Kiyotaka Oku

Osaka Venture Meetup #3
Osaka Venture Meetup #3Osaka Venture Meetup #3
Osaka Venture Meetup #3Kiyotaka Oku
 
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱Kiyotaka Oku
 
日本Grails/Groovyユーザーグループ
日本Grails/Groovyユーザーグループ日本Grails/Groovyユーザーグループ
日本Grails/GroovyユーザーグループKiyotaka Oku
 
Jenkinsプラグインの作り方
Jenkinsプラグインの作り方Jenkinsプラグインの作り方
Jenkinsプラグインの作り方Kiyotaka Oku
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and GroovyKiyotaka Oku
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語Kiyotaka Oku
 
Groovy and-hudson2
Groovy and-hudson2Groovy and-hudson2
Groovy and-hudson2Kiyotaka Oku
 

Más de Kiyotaka Oku (14)

Osaka Venture Meetup #3
Osaka Venture Meetup #3Osaka Venture Meetup #3
Osaka Venture Meetup #3
 
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
 
日本Grails/Groovyユーザーグループ
日本Grails/Groovyユーザーグループ日本Grails/Groovyユーザーグループ
日本Grails/Groovyユーザーグループ
 
GroovyConsole2
GroovyConsole2GroovyConsole2
GroovyConsole2
 
GroovyConsole
GroovyConsoleGroovyConsole
GroovyConsole
 
Jenkinsプラグインの作り方
Jenkinsプラグインの作り方Jenkinsプラグインの作り方
Jenkinsプラグインの作り方
 
Devsumi Openjam
Devsumi OpenjamDevsumi Openjam
Devsumi Openjam
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and Groovy
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
 
Mote Hudson
Mote HudsonMote Hudson
Mote Hudson
 
Groovy and-hudson2
Groovy and-hudson2Groovy and-hudson2
Groovy and-hudson2
 
Gaelyk
GaelykGaelyk
Gaelyk
 
JDO
JDOJDO
JDO
 
Grails on GAE/J
Grails on GAE/JGrails on GAE/J
Grails on GAE/J
 

Último

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Último (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Griffon不定期便〜G*ワークショップ編〜

  • 1. Griffon G* 2011 9 23
  • 2. id:kiy0taka @kiy0taka JGGUG G*Magazine Griffon Griffon (?) 2011 9 23
  • 3. create-command-alias $ griffon create-command-alias hoge > test-app unit: foo.BarTests $ griffon hoge Grails Griffon (ry 2011 9 23
  • 4. Griffon Grails 2011 9 23
  • 5. Java package sample; contentPane.add(button); import java.awt.Container; setDefaultCloseOperation(EXIT_ON_CLOSE); import java.awt.GridLayout; pack(); import java.awt.event.ActionEvent; setVisible(true); import java.awt.event.ActionListener; } import javax.swing.JButton; public static void main(String[] args) { import javax.swing.JFrame; SwingUtilities.invokeLater(new Runnable() { import javax.swing.JLabel; public void run() { import javax.swing.JTextArea; new Hello(); import javax.swing.SwingUtilities; } }); public class Hello extends JFrame { } } public Hello() { super("Hello"); Container contentPane = getContentPane(); contentPane.setLayout(new GridLayout(3, 1)); JLabel label = new JLabel("Label"); contentPane.add(label); JTextArea textArea = new JTextArea("Text Area"); textArea.setColumns(20); textArea.setRows(2); contentPane.add(textArea); JButton button = new JButton("Button"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { } }); 2011 9 23
  • 6. Groovy import groovy.swing.SwingBuilder new SwingBuilder().edt { frame(title:'Hello', show:true, pack:true) { gridLayout(cols:1, rows:3) label 'Label' textArea('Text Area', rows:2, columns:20) button('Button', actionPerformed:{ evt -> ... }) } } 2011 9 23
  • 7. Java button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ... } }); SwingUtilities.invokeLater(new Runnable() { public void run() { ... } }); 2011 9 23
  • 8. & export GRIFFON_HOME=/path/to/griffon export PATH=$GRIFFON_HOME/bin:$PATH 2011 9 23
  • 9. griffon [ ] griffon create-app myApp griffon run-app griffon test-app griffon package 2011 9 23
  • 10. Grails 2011 9 23
  • 11. Griffon Wrapper griffonw / griffonw.bat Griffon gradlew CI 2011 9 23
  • 12. View 2011 9 23
  • 13. View SwingBuilder 2011 9 23
  • 14. SwingBuilder groovy.swing.SwingBuilder Groovy javax.swing.JXxx -> xxx() JButton -> button() JLabel -> label() 2011 9 23
  • 15. View application(title:'Sample', pack:true, ...) { tableLayout { tr { td { label('User Name') } td { textField(columns:20) } } tr { td { label('Password') } td { passwordField(columns:20) } } tr { td(colspan:2, align:'right') { button('Submit') } } } } 2011 9 23
  • 16. View // MyMenuBar.groovy menuBar { menu('File') { menuItem('Open') menuItem('Save') } } // MyAppView.groovy application(...) { build(MyMenuBar) } 2011 9 23
  • 17. View Java // MyPanel.java class MyPanel extends JPanel { ... } // MyAppView.groovy application(...) { widget(new MyPanel()) } 2011 9 23
  • 20. View SwingPad GroovyConsole 2011 9 23
  • 21. SwingBuilder View SwingPad 2011 9 23
  • 22. generate-view-script NetBeans View Griffon NetBeans Griffon 2011 9 23
  • 23. Model 2011 9 23
  • 24. Model package sample class SampleModel { String username String password } 2011 9 23
  • 25. View Model Model View 2011 9 23
  • 26. Model package sample import groovy.beans.Bindable class SampleModel { @Bindable String username @Bindable String password } 2011 9 23
  • 27. Model package sample import groovy.beans.Bindable @Bindable class SampleModel { String username String password } 2011 9 23
  • 28. View -> Model textField(text:bind(target:model, targetProperty:‘username’)) textField(text:bind(target:model, ‘username’)) 2011 9 23
  • 29. Model -> View textField(text:bind(source:model, sourceProperty:‘username’)) textField(text:bind(source:model, ‘username’)) textField(text:bind { model.username }) 2011 9 23
  • 30. View -> View buttonGroup(id:'group1') radioButton(id:‘radio1’, ‘ ’, buttonGroup:group1) radioButton(id:‘radio2’, ‘ ’, buttonGroup:group1) textField(editable:bind(source:radio1, sourceEvent:‘itemStateChanged’, sourceValue:{radio1.selected})) 2011 9 23
  • 31. // Model class Model { Date now = new Date() } // View label(text:bind(‘now’, source:model, converter:{it.format(‘yyyy-MM-dd’)})) 2011 9 23
  • 32. // Model class Model { int num } // View textField(text:bind(‘num’, target:model, validator:{ it?.isInteger() })) 2011 9 23
  • 33. constraints? class MyModel { @Bindable String requiredText @Bindable String url @Bindable String email static constraints = { requiredText(blank:false) url(url:true) email(email:true) } } 2011 9 23
  • 34. Validation Grails constraints Model model.validate() model.errors net.sourceforge.gvalidation.swing.ErrorMessagePanel 2011 9 23
  • 35. ErrorMessagePanel // View widget(new ErrorMessagePanel(messageSource), errors: bind(source: model, 'errors')) 2011 9 23
  • 37. Controller class SampleController { def model def view void mvcGroupInit(Map args) { ... } void mvcGroupDestroy() { ... } def fooAction = { evt -> ... } def barAction = { evt -> ... } } 2011 9 23
  • 38. View button(‘Click!’, actionPerformed:controller.fooAction) 2011 9 23
  • 39. Model View Controller Model View 2011 9 23
  • 40. Controller ( < 0.9.2 ) 0.9.2 UI 2011 9 23
  • 41. @Threading griffon.transform.Threading 2011 9 23
  • 42. class MyController { @Threading(Threading.Policy.INSIDE_UITHREAD_SYNC) def myAction = { } } 2011 9 23
  • 43. Threading.Policy OUTSIDE_UITHREAD ( ) INSIDE_UITHREAD_SYNC UI INSIDE_UITHREAD_ASYNC UI SKIP 2011 9 23
  • 44. class MyController { def myAction = { // execSync { // UI execOutside { // } } } } 2011 9 23
  • 45. exec execSync UI execAsync UI execOutside 2011 9 23
  • 46. Java/Groovy/Griffon Java Groovy Griffon new Thread() doOutside execOutside invokeLater doLater execAsync invokeAndWait edt execSync 2011 9 23
  • 47. MVC Model View Controller MVC griffon create-mvc myNewGroup 2011 9 23
  • 48. create-mvc -skip(View|Model|Controller) View/Model/Controller MVC -fileType=(groovy|java|etc) Java 2011 9 23
  • 49. createMvcGroup MVC createMvcGroup(groupType, groupName, args) 2011 9 23
  • 50. MVC SplitPane MVC TabbedPane MVC View MVC 2011 9 23
  • 51. Group1 // View button('Add tab', actionPerformed:controller.addTab) tabbedPane id: 'tabGroup' // Controller def addTab = { def name = new Date().format('yyyy-MM-dd HH:mm:ss') createMVCGroup("tab", name [tabGroup: view.tabGroup, tabName: name]) } 2011 9 23
  • 52. Group2 // View tabbedPane(tabGroup, selectedIndex:tabGroup.tabCount) { panel(title: tabName) { label(tabName) } } 2011 9 23
  • 54. Spock + FEST class CalcSpec extends FestSpec { def 'my first FEST spec'() { when: window.textBox('arg1').enterText(arg1) window.textBox('arg2').enterText(arg2) window.button('calculate').click() then: window.label('result').requireText(result) where: arg1 | arg2 | result '1' | '1' | '2' '1' | '2' | '3' } } 2011 9 23
  • 55. WebStart/Applet/Jar/Zip griffon package [webstart|applet|jar|zip] izpack|mac|rpm|deb|jsmooth 2011 9 23
  • 56. 0.9.3 Griffon 0.9.3 2011 9 23