Devsumi Openjam
Upcoming SlideShare
Loading in...5
×
 

Devsumi Openjam

on

  • 2,176 views

 

Statistics

Views

Total Views
2,176
Views on SlideShare
1,942
Embed Views
234

Actions

Likes
1
Downloads
3
Comments
0

4 Embeds 234

http://d.hatena.ne.jp 227
http://kiy0taka.hatenablog.com 4
http://coderwall.com 2
http://webcache.googleusercontent.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Devsumi Openjam Devsumi Openjam Presentation Transcript

  • 2011 2 26
  • Griffon Groovy Swing DI MVC CoC Java2011 2 26
  • 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
  • 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
  • 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
  • 2011 2 26
  • Java Swing2011 2 26
  • 2011 2 26
  • button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ... } }); SwingUtilities.invokeLater(new Runnable() { public void run() { ... } });2011 2 26
  • 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
  • Groovy2011 2 26
  • 2011 2 26
  • Getting Started $ griffon create-app myapp $ cd myapp $ griffon run-app2011 2 26
  • Griffon MVC MVC2011 2 26
  • 2011 2 26
  • // Model import groovy.beans.Bindable class SampleModel { @Bindable String text } // View application(...) { textField(text:bind(source:model, ’text’)) } Model View2011 2 26
  • // Model import groovy.beans.Bindable class SampleModel { @Bindable String text } // View application(...) { textField(text:bind(target:model, ’text’)) } View Model2011 2 26
  • 2011 2 26
  • 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
  • Groovy // Controller def heavyAction = { evt -> doOutside { heavyTask() edt { textArea.append Complete!n } } }2011 2 26
  • 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