Your SlideShare is downloading. ×
0
2011   2   26
Griffon                Groovy                Swing                DI   MVC   CoC                            Java2011   2  ...
Swing(Java)       package sample;                                                        contentPane.add(button);       im...
Groovy                import groovy.swing.SwingBuilder                new SwingBuilder().edt {                    frame(ti...
import groovy.swing.SwingBuilder           new SwingBuilder().edt {               frame(title:Login, show:true, pack:true)...
2011   2   26
Java Swing2011   2   26
2011   2   26
button.addActionListener(new ActionListener() {                    public void actionPerformed(ActionEvent e) {           ...
Groovy                import groovy.swing.SwingBuilder                new SwingBuilder().edt {                    frame(ti...
Groovy2011   2   26
2011   2   26
Getting Started                $ griffon create-app myapp                $ cd myapp                $ griffon run-app2011  ...
Griffon   MVC                MVC2011   2   26
2011   2   26
// Model                import groovy.beans.Bindable                class SampleModel {                    @Bindable Strin...
// Model                import groovy.beans.Bindable                class SampleModel {                    @Bindable Strin...
2011   2   26
Java                public void actionPerformed(ActionEvent evt) {                    new Thread() {                      ...
Groovy                // Controller                def heavyAction = { evt ->                    doOutside {              ...
2011   2   26
2011   2   26
2011   2   26
2011   2   26
2011   2   26
http://www.jroller.com/aalmiray/entry/so_who_uses_griffon_afterall2011   2   26
2011   2   26
Upcoming SlideShare
Loading in...5
×

Devsumi Openjam

2,057

Published on

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,057
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Devsumi Openjam"

  1. 1. 2011 2 26
  2. 2. Griffon Groovy Swing DI MVC CoC Java2011 2 26
  3. 3. Swing(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 2 26
  4. 4. 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 2 26
  5. 5. import groovy.swing.SwingBuilder new SwingBuilder().edt { frame(title:Login, show:true, 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 2 26
  6. 6. 2011 2 26
  7. 7. Java Swing2011 2 26
  8. 8. 2011 2 26
  9. 9. button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ... } }); SwingUtilities.invokeLater(new Runnable() { public void run() { ... } });2011 2 26
  10. 10. 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 2 26
  11. 11. Groovy2011 2 26
  12. 12. 2011 2 26
  13. 13. Getting Started $ griffon create-app myapp $ cd myapp $ griffon run-app2011 2 26
  14. 14. Griffon MVC MVC2011 2 26
  15. 15. 2011 2 26
  16. 16. // Model import groovy.beans.Bindable class SampleModel { @Bindable String text } // View application(...) { textField(text:bind(source:model, ’text’)) } Model View2011 2 26
  17. 17. // Model import groovy.beans.Bindable class SampleModel { @Bindable String text } // View application(...) { textField(text:bind(target:model, ’text’)) } View Model2011 2 26
  18. 18. 2011 2 26
  19. 19. Java public void actionPerformed(ActionEvent evt) { new Thread() { public void run() { heavyTask(); try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { textArea.append("Complete!n"); } }); } catch (InterruptedException e) { ... } catch (InvocationTargetException e) { ... } } }.start(); }2011 2 26
  20. 20. Groovy // Controller def heavyAction = { evt -> doOutside { heavyTask() edt { textArea.append Complete!n } } }2011 2 26
  21. 21. 2011 2 26
  22. 22. 2011 2 26
  23. 23. 2011 2 26
  24. 24. 2011 2 26
  25. 25. 2011 2 26
  26. 26. http://www.jroller.com/aalmiray/entry/so_who_uses_griffon_afterall2011 2 26
  27. 27. 2011 2 26
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×