SlideShare a Scribd company logo
1 of 44
JavaFX Tutorial
    Shuji Watanabe
About Me
Shuji Watanabe
Sapporo, Japan
Twitter: shuji_w6e
http://www.deathmarch.jp/
http://trac.deathmarch.jp/sunflower/
http://d.hatena.ne.jp/shuji_w6e/
Agenda

Stage / Scene
Event
Bind
Animation
Stage / Scene
Stage

JavaFX



 Applet
Scene


 Scene
Node

Scene

               Node
Ex01_HelloFX.fx
Stage {
    title : "Ex01_HelloFX"
    scene: Scene {
        width: 200, height: 200
        content: [
            Rectangle {
                layoutX: 50, layoutY: 50
                width: 100, height: 50
                fill: Color.GREENYELLOW
            }// Rectagle
        ]
    }// Scene
}// Stage
Stage {
    title : "Ex01_HelloFX"
    scene: Scene {
       •new
        width: 200, height: 200
        content: [
       •    Rectangle {
                                       {}
                layoutX: 50, layoutY: 50
                width: 100, height: 50
                fill: Color.GREENYELLOW
            }// Rectagle
        ]
    }// Scene
}// Stage
Stage {
    title : "Ex01_HelloFX"
    scene: Scene {
        width: 200, height: 200
    •   content: [
            Rectangle {
    • <        >: < > 50, layoutY: 50
                layoutX:
                width: 100, height: 50
    •           fill: Color.GREENYELLOW
            }// Rectagle
        ]
    }// Scene
}// Stage
Stage {
•   title : "Ex01_HelloFX"
•       []
    scene: Scene {
        width: 200, height: 200
        content: [
            Rectangle {
                layoutX: 50, layoutY: 50
                width: 100, height: 50
                fill: Color.GREENYELLOW
            }// Rectagle
        ]
    }// Scene
}// Stage
Event
Variables
     var
var msg:String = “Hello World”;




var msg = “Hello World”;


                           def
def HELLO = “Hello World”;
Function
function <          >(       ): <        > {}



function showMessage(msg: String):Void {
    println(msg);
}
var showMsg = function(msg: String):Void {
    println(msg);
}
onMouseXxx

javafx.scene.Node

funtction
Ex02_MousePressed.fx
Stage {
    scene: Scene {
        content: Circle {
            centerX: 50, centerY: 50, radius: 50
            fill: Color.RED
            onMousePressed: function(e:MouseEvent): Void {
                println("Click!");
            }
        }
    }
}
Stage {
    scene: Scene {
        content: Circle {
            centerX: 50, centerY: 50, radius: 50
            fill: Color.RED
            onMousePressed: function(e) {
                println("Click!");
            }
        }      • onMousePressed
    }
}
               •
def printFunc = function(e:MouseEvent): Void {
    println("Click!");
}
Stage {
    scene: Scene {
        content: Circle {
            centerX: 50, centerY: 50, radius: 50
            fill: Color.RED
            onMousePressed: printFunc
        }


}
    }
               •
function printFunc(e:MouseEvent): Void {
    println("Click!");
}
Stage {
    scene: Scene {
        content: Circle {
            centerX: 50, centerY: 50, radius: 50
            fill: Color.RED
            onMousePressed: printFunc
        }


}
    }
               •
Bind
String.format


var x = 10;
println(“x=   {x}”); // x = 10
println(“x=   {x*2}”); // x = 20
println(“x=   {func(x)}”);
println(“x=   {%d04 x}”); // 0010
Bind



var x = 10;
var x0 = bind x;
var x1 = bind x + 2;
x = 20;
println(“{x},{x0},{x1}”);
Ex03_Bind.fx
var count = 0;
Stage {
    scene: Scene {
        content: Flow {
            content: [
                Label { text: bind "count: {count}" }
                Button {
                    text: "Up"
                    action: function() { count++; }
                }
            ]
        }
    }
}
Flow
var count = 0;
Stage {
    scene: Scene {
        content: Flow {
            content: [
                Label { text: bind "count: {count}" }
                Button {
                    text: "Up"
                    action: function() { count++; }
                }
            ]
        }        •
    }
}
Ex03_Bind.fx
var count = 0;  •      count:Integer
Stage {
    scene: Scene {
        content: Flow {
            content: [
                Label { text: bind "count: {count}" }
                Button {
                    text: "Up"
                    action: function() { count++; }
                }


        }
            ]
                    •
                    Button
    }               •
                    Label text count bind
}
Ex04_InputButton.fx
var textBox: TextBox;
Stage {
    scene: Scene {
        content: Flow {
            content: [
                textBox = TextBox {}
                Button {
                  text: "Submit"
                  disable: bind textBox.rawText.length() == 0
                }
            ]
        }
    }
}
Ex04_InputButton.fx
var textBox: TextBox;   •                   Object
Stage {
    scene: Scene {
        content: Flow {
            content: [
                textBox = TextBox {}
                Button {
                   text: "Submit"
   •               disable: bind textBox.rawText.length() == 0
                }
   •        ]
   •    }
    }
}
Ex04_InputButton.fx
var textBox: TextBox;
Stage {
    scene: Scene {
        content: Flow {
            content: [
                textBox = TextBox {}
                Button {
                   text: "Submit"
                   disable: bind textBox.rawText.length() == 0
                }
            ]         •                   bind
        }
    }
}
Animation
Duration

ms, s, m, h


var x = 10ms; // 10s, 1m, 2h...
var x2 = x * 200; // 2,000ms = 2s
var x3 = x2 / 2; // 1s
if (x2 < x3) ....
Timeline


     0s



stop > play > stop
KeyFrame

Timeline



 0s, 10s, 20s...
 x=10, x=30, x=100...
Tween
  x              KeyFrame
100
           Easein
                    Liner

30
         Easeout
0
    0s     10s          20s   10s   1
Ex05_Timeline.fx
var x = 0.0;
var ball: Circle;
Stage {
    title : "Ex05_Timeline"
    scene: Scene {
        width: 200
        height: 200
        content: ball = Circle {
            layoutX: bind x, layoutY: bind 0.005 * x * x
            radius: 5, fill: Color.BLUE
        }
    }
}
Ex05_Timeline.fx
Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        KeyFrame {
           time: 0s
           values: [x => 0]
        }
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
        }
    ]
}.play();
Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
                •
        KeyFrame {
           time: 0s
           values: [x => 0]
        }
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
        }
    ]
}.play();
KeyFrame
Timeline {              •
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
                        •time
        KeyFrame {      •               KeyFrame
           time: 0s
           values: [x => 0]
        }
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
        }
    ]
}.play();
Tween
Timeline {
                        •KeyFrame
    repeatCount: Timeline.INDEFINITE
    keyFrames: [        •x Linier
        KeyFrame {
           time: 0s
           values: [x => 0]
        }
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
        }
    ]
}.play();
play
Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        KeyFrame {

              •
           time: 0s
           values: [x => 0]
        }     •                       orz
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
        }
    ]
}.play();
OK
 var timeline = Timeline {
     repeatCount: Timeline.INDEFINITE
     keyFrames: [
         KeyFrame {
               •
            time: 0s                  play
            values: [x => 0]
         }
               • Timeline
         KeyFrame {
            time: 10s
            values: [x => 200 tween Interpolator.LINEAR]
         }
     ]
};
timeline.play();
at
Timeline {              •KeyFrame
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        at(0s { x=> 0})
        at(10s { x=> 200 tween Interpolator.LINEAR})
    ]
}.play();
action
Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        KeyFrame {
           time: 0s
           values: [x => 0]
        }
        KeyFrame {
           time: 10s
           values: [x => 200 tween Interpolator.LINEAR]
           action: function() { println(“end”); }
        }
    ]               •
}.play();
                    •at
Next...

if
for
Group
Effect
Thank you!

More Related Content

What's hot

Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 
ゼロから始めるScala文法
ゼロから始めるScala文法ゼロから始めるScala文法
ゼロから始めるScala文法Ryuichi ITO
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 46 of 196
The Ring programming language version 1.7 book - Part 46 of 196The Ring programming language version 1.7 book - Part 46 of 196
The Ring programming language version 1.7 book - Part 46 of 196Mahmoud Samir Fayed
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Chang W. Doh
 
関数プログラミングことはじめ revival
関数プログラミングことはじめ revival関数プログラミングことはじめ revival
関数プログラミングことはじめ revivalNaoki Kitora
 
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Philip Schwarz
 
Simple flat ui css accordion
Simple flat ui css accordionSimple flat ui css accordion
Simple flat ui css accordionSamsury Blog
 
The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31Mahmoud Samir Fayed
 
Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2Evgeny Borisov
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency명신 김
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 23 of 196
The Ring programming language version 1.7 book - Part 23 of 196The Ring programming language version 1.7 book - Part 23 of 196
The Ring programming language version 1.7 book - Part 23 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 55 of 196
The Ring programming language version 1.7 book - Part 55 of 196The Ring programming language version 1.7 book - Part 55 of 196
The Ring programming language version 1.7 book - Part 55 of 196Mahmoud Samir Fayed
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ applicationDaniele Pallastrelli
 
MultiClient chatting berbasis gambar
MultiClient chatting berbasis gambarMultiClient chatting berbasis gambar
MultiClient chatting berbasis gambaryoyomay93
 
Comunicação Bluetooth Entre Python e PyS60
Comunicação Bluetooth Entre Python e PyS60Comunicação Bluetooth Entre Python e PyS60
Comunicação Bluetooth Entre Python e PyS60Felipe Ronchi Brigido
 

What's hot (20)

Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
ゼロから始めるScala文法
ゼロから始めるScala文法ゼロから始めるScala文法
ゼロから始めるScala文法
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
 
Rumus VB-1
Rumus VB-1Rumus VB-1
Rumus VB-1
 
The Ring programming language version 1.7 book - Part 46 of 196
The Ring programming language version 1.7 book - Part 46 of 196The Ring programming language version 1.7 book - Part 46 of 196
The Ring programming language version 1.7 book - Part 46 of 196
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가
 
関数プログラミングことはじめ revival
関数プログラミングことはじめ revival関数プログラミングことはじめ revival
関数プログラミングことはじめ revival
 
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
 
Simple flat ui css accordion
Simple flat ui css accordionSimple flat ui css accordion
Simple flat ui css accordion
 
The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31
 
Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2Groovy puzzlers jug-moscow-part 2
Groovy puzzlers jug-moscow-part 2
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
 
The Ring programming language version 1.7 book - Part 23 of 196
The Ring programming language version 1.7 book - Part 23 of 196The Ring programming language version 1.7 book - Part 23 of 196
The Ring programming language version 1.7 book - Part 23 of 196
 
Lập trình Python cơ bản
Lập trình Python cơ bảnLập trình Python cơ bản
Lập trình Python cơ bản
 
The Ring programming language version 1.7 book - Part 55 of 196
The Ring programming language version 1.7 book - Part 55 of 196The Ring programming language version 1.7 book - Part 55 of 196
The Ring programming language version 1.7 book - Part 55 of 196
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ application
 
MultiClient chatting berbasis gambar
MultiClient chatting berbasis gambarMultiClient chatting berbasis gambar
MultiClient chatting berbasis gambar
 
Comunicação Bluetooth Entre Python e PyS60
Comunicação Bluetooth Entre Python e PyS60Comunicação Bluetooth Entre Python e PyS60
Comunicação Bluetooth Entre Python e PyS60
 

Similar to Java Fx Tutorial01

Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech TourCarol McDonald
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?Adam Dudczak
 
Getting Visual with Ruby Processing
Getting Visual with Ruby ProcessingGetting Visual with Ruby Processing
Getting Visual with Ruby ProcessingRichard LeBer
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXStephen Chin
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonAlex Payne
 
The Ring programming language version 1.2 book - Part 19 of 84
The Ring programming language version 1.2 book - Part 19 of 84The Ring programming language version 1.2 book - Part 19 of 84
The Ring programming language version 1.2 book - Part 19 of 84Mahmoud Samir Fayed
 
WPF L02-Graphics, Binding and Animation
WPF L02-Graphics, Binding and AnimationWPF L02-Graphics, Binding and Animation
WPF L02-Graphics, Binding and AnimationMohammad Shaker
 
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184Mahmoud Samir Fayed
 

Similar to Java Fx Tutorial01 (20)

Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech Tour
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
Corona sdk
Corona sdkCorona sdk
Corona sdk
 
Getting Visual with Ruby Processing
Getting Visual with Ruby ProcessingGetting Visual with Ruby Processing
Getting Visual with Ruby Processing
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
 
Raspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFXRaspberry Pi à la GroovyFX
Raspberry Pi à la GroovyFX
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Ext JS (Greek)
Ext JS (Greek)Ext JS (Greek)
Ext JS (Greek)
 
Mini-curso JavaFX Aula1
Mini-curso JavaFX Aula1Mini-curso JavaFX Aula1
Mini-curso JavaFX Aula1
 
The Ring programming language version 1.2 book - Part 19 of 84
The Ring programming language version 1.2 book - Part 19 of 84The Ring programming language version 1.2 book - Part 19 of 84
The Ring programming language version 1.2 book - Part 19 of 84
 
WPF L02-Graphics, Binding and Animation
WPF L02-Graphics, Binding and AnimationWPF L02-Graphics, Binding and Animation
WPF L02-Graphics, Binding and Animation
 
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
 
Notes
NotesNotes
Notes
 
Array notes
Array notesArray notes
Array notes
 
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
 

More from Shuji Watanabe

Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Shuji Watanabe
 
Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017Shuji Watanabe
 
SSMでマネージドEC2 #reinvent #cmdevio
SSMでマネージドEC2 #reinvent #cmdevioSSMでマネージドEC2 #reinvent #cmdevio
SSMでマネージドEC2 #reinvent #cmdevioShuji Watanabe
 
プロビジョニングの今 ーフルマネージド・サービスを目指してー #cmdevio2016 #E
プロビジョニングの今 ーフルマネージド・サービスを目指してー  #cmdevio2016 #Eプロビジョニングの今 ーフルマネージド・サービスを目指してー  #cmdevio2016 #E
プロビジョニングの今 ーフルマネージド・サービスを目指してー #cmdevio2016 #EShuji Watanabe
 
AWSによるWebサイト構築と運用 - concrete5 編 -
AWSによるWebサイト構築と運用 - concrete5 編 -AWSによるWebサイト構築と運用 - concrete5 編 -
AWSによるWebサイト構築と運用 - concrete5 編 -Shuji Watanabe
 
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003Shuji Watanabe
 
CloudSearchによる全文検索 - CM:道 2014/08/01
CloudSearchによる全文検索 - CM:道 2014/08/01 CloudSearchによる全文検索 - CM:道 2014/08/01
CloudSearchによる全文検索 - CM:道 2014/08/01 Shuji Watanabe
 
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014Shuji Watanabe
 
TDD BootCamp in JJUG CCC - レガシーコード対策編 -
TDD BootCamp in JJUG CCC - レガシーコード対策編 -TDD BootCamp in JJUG CCC - レガシーコード対策編 -
TDD BootCamp in JJUG CCC - レガシーコード対策編 -Shuji Watanabe
 
s3+cloud frontによる静的コンテンツ配信 - Sphinx編 #cmdevio
s3+cloud frontによる静的コンテンツ配信 - Sphinx編  #cmdevios3+cloud frontによる静的コンテンツ配信 - Sphinx編  #cmdevio
s3+cloud frontによる静的コンテンツ配信 - Sphinx編 #cmdevioShuji Watanabe
 
クラスメソッド会社説明会in札幌 — メンバー紹介 #cmdevio
クラスメソッド会社説明会in札幌 — メンバー紹介   #cmdevioクラスメソッド会社説明会in札幌 — メンバー紹介   #cmdevio
クラスメソッド会社説明会in札幌 — メンバー紹介 #cmdevioShuji Watanabe
 
テスト駆動開発へようこそ
テスト駆動開発へようこそテスト駆動開発へようこそ
テスト駆動開発へようこそShuji Watanabe
 
テスト駆動開発のはじめ方
テスト駆動開発のはじめ方テスト駆動開発のはじめ方
テスト駆動開発のはじめ方Shuji Watanabe
 
ユースケースからテスト駆動開発へ
ユースケースからテスト駆動開発へユースケースからテスト駆動開発へ
ユースケースからテスト駆動開発へShuji Watanabe
 
テスト駆動開発入門
テスト駆動開発入門テスト駆動開発入門
テスト駆動開発入門Shuji Watanabe
 
テストコードのリファクタリング
テストコードのリファクタリングテストコードのリファクタリング
テストコードのリファクタリングShuji Watanabe
 
テスト駆動開発の導入ーペアプログラミングの学習効果ー
テスト駆動開発の導入ーペアプログラミングの学習効果ーテスト駆動開発の導入ーペアプログラミングの学習効果ー
テスト駆動開発の導入ーペアプログラミングの学習効果ーShuji Watanabe
 
JUnit実践入門 xUnitTestPatternsで学ぶユニットテスト
JUnit実践入門 xUnitTestPatternsで学ぶユニットテストJUnit実践入門 xUnitTestPatternsで学ぶユニットテスト
JUnit実践入門 xUnitTestPatternsで学ぶユニットテストShuji Watanabe
 
アジャイルテスティング
アジャイルテスティングアジャイルテスティング
アジャイルテスティングShuji Watanabe
 

More from Shuji Watanabe (20)

Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019
 
Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017
 
SSMでマネージドEC2 #reinvent #cmdevio
SSMでマネージドEC2 #reinvent #cmdevioSSMでマネージドEC2 #reinvent #cmdevio
SSMでマネージドEC2 #reinvent #cmdevio
 
プロビジョニングの今 ーフルマネージド・サービスを目指してー #cmdevio2016 #E
プロビジョニングの今 ーフルマネージド・サービスを目指してー  #cmdevio2016 #Eプロビジョニングの今 ーフルマネージド・サービスを目指してー  #cmdevio2016 #E
プロビジョニングの今 ーフルマネージド・サービスを目指してー #cmdevio2016 #E
 
ELBの概要と勘所
ELBの概要と勘所ELBの概要と勘所
ELBの概要と勘所
 
AWSによるWebサイト構築と運用 - concrete5 編 -
AWSによるWebサイト構築と運用 - concrete5 編 -AWSによるWebサイト構築と運用 - concrete5 編 -
AWSによるWebサイト構築と運用 - concrete5 編 -
 
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003
Cloud FormationによるBlue-Green Deployment - Dev io mtup11 003
 
CloudSearchによる全文検索 - CM:道 2014/08/01
CloudSearchによる全文検索 - CM:道 2014/08/01 CloudSearchによる全文検索 - CM:道 2014/08/01
CloudSearchによる全文検索 - CM:道 2014/08/01
 
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014
Javaアプリケーション開発におけるユニットテストとTDDの実践 Java Day Tokyo 2014
 
TDD BootCamp in JJUG CCC - レガシーコード対策編 -
TDD BootCamp in JJUG CCC - レガシーコード対策編 -TDD BootCamp in JJUG CCC - レガシーコード対策編 -
TDD BootCamp in JJUG CCC - レガシーコード対策編 -
 
s3+cloud frontによる静的コンテンツ配信 - Sphinx編 #cmdevio
s3+cloud frontによる静的コンテンツ配信 - Sphinx編  #cmdevios3+cloud frontによる静的コンテンツ配信 - Sphinx編  #cmdevio
s3+cloud frontによる静的コンテンツ配信 - Sphinx編 #cmdevio
 
クラスメソッド会社説明会in札幌 — メンバー紹介 #cmdevio
クラスメソッド会社説明会in札幌 — メンバー紹介   #cmdevioクラスメソッド会社説明会in札幌 — メンバー紹介   #cmdevio
クラスメソッド会社説明会in札幌 — メンバー紹介 #cmdevio
 
テスト駆動開発へようこそ
テスト駆動開発へようこそテスト駆動開発へようこそ
テスト駆動開発へようこそ
 
テスト駆動開発のはじめ方
テスト駆動開発のはじめ方テスト駆動開発のはじめ方
テスト駆動開発のはじめ方
 
ユースケースからテスト駆動開発へ
ユースケースからテスト駆動開発へユースケースからテスト駆動開発へ
ユースケースからテスト駆動開発へ
 
テスト駆動開発入門
テスト駆動開発入門テスト駆動開発入門
テスト駆動開発入門
 
テストコードのリファクタリング
テストコードのリファクタリングテストコードのリファクタリング
テストコードのリファクタリング
 
テスト駆動開発の導入ーペアプログラミングの学習効果ー
テスト駆動開発の導入ーペアプログラミングの学習効果ーテスト駆動開発の導入ーペアプログラミングの学習効果ー
テスト駆動開発の導入ーペアプログラミングの学習効果ー
 
JUnit実践入門 xUnitTestPatternsで学ぶユニットテスト
JUnit実践入門 xUnitTestPatternsで学ぶユニットテストJUnit実践入門 xUnitTestPatternsで学ぶユニットテスト
JUnit実践入門 xUnitTestPatternsで学ぶユニットテスト
 
アジャイルテスティング
アジャイルテスティングアジャイルテスティング
アジャイルテスティング
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Java Fx Tutorial01

  • 1. JavaFX Tutorial Shuji Watanabe
  • 2. About Me Shuji Watanabe Sapporo, Japan Twitter: shuji_w6e http://www.deathmarch.jp/ http://trac.deathmarch.jp/sunflower/ http://d.hatena.ne.jp/shuji_w6e/
  • 7. Node Scene Node
  • 8. Ex01_HelloFX.fx Stage { title : "Ex01_HelloFX" scene: Scene { width: 200, height: 200 content: [ Rectangle { layoutX: 50, layoutY: 50 width: 100, height: 50 fill: Color.GREENYELLOW }// Rectagle ] }// Scene }// Stage
  • 9. Stage { title : "Ex01_HelloFX" scene: Scene { •new width: 200, height: 200 content: [ • Rectangle { {} layoutX: 50, layoutY: 50 width: 100, height: 50 fill: Color.GREENYELLOW }// Rectagle ] }// Scene }// Stage
  • 10. Stage { title : "Ex01_HelloFX" scene: Scene { width: 200, height: 200 • content: [ Rectangle { • < >: < > 50, layoutY: 50 layoutX: width: 100, height: 50 • fill: Color.GREENYELLOW }// Rectagle ] }// Scene }// Stage
  • 11. Stage { • title : "Ex01_HelloFX" • [] scene: Scene { width: 200, height: 200 content: [ Rectangle { layoutX: 50, layoutY: 50 width: 100, height: 50 fill: Color.GREENYELLOW }// Rectagle ] }// Scene }// Stage
  • 12. Event
  • 13. Variables var var msg:String = “Hello World”; var msg = “Hello World”; def def HELLO = “Hello World”;
  • 14. Function function < >( ): < > {} function showMessage(msg: String):Void { println(msg); } var showMsg = function(msg: String):Void { println(msg); }
  • 16. Ex02_MousePressed.fx Stage { scene: Scene { content: Circle { centerX: 50, centerY: 50, radius: 50 fill: Color.RED onMousePressed: function(e:MouseEvent): Void { println("Click!"); } } } }
  • 17. Stage { scene: Scene { content: Circle { centerX: 50, centerY: 50, radius: 50 fill: Color.RED onMousePressed: function(e) { println("Click!"); } } • onMousePressed } } •
  • 18. def printFunc = function(e:MouseEvent): Void { println("Click!"); } Stage { scene: Scene { content: Circle { centerX: 50, centerY: 50, radius: 50 fill: Color.RED onMousePressed: printFunc } } } •
  • 19. function printFunc(e:MouseEvent): Void { println("Click!"); } Stage { scene: Scene { content: Circle { centerX: 50, centerY: 50, radius: 50 fill: Color.RED onMousePressed: printFunc } } } •
  • 20. Bind
  • 21. String.format var x = 10; println(“x= {x}”); // x = 10 println(“x= {x*2}”); // x = 20 println(“x= {func(x)}”); println(“x= {%d04 x}”); // 0010
  • 22. Bind var x = 10; var x0 = bind x; var x1 = bind x + 2; x = 20; println(“{x},{x0},{x1}”);
  • 23. Ex03_Bind.fx var count = 0; Stage { scene: Scene { content: Flow { content: [ Label { text: bind "count: {count}" } Button { text: "Up" action: function() { count++; } } ] } } }
  • 24. Flow var count = 0; Stage { scene: Scene { content: Flow { content: [ Label { text: bind "count: {count}" } Button { text: "Up" action: function() { count++; } } ] } • } }
  • 25. Ex03_Bind.fx var count = 0; • count:Integer Stage { scene: Scene { content: Flow { content: [ Label { text: bind "count: {count}" } Button { text: "Up" action: function() { count++; } } } ] • Button } • Label text count bind }
  • 26. Ex04_InputButton.fx var textBox: TextBox; Stage { scene: Scene { content: Flow { content: [ textBox = TextBox {} Button { text: "Submit" disable: bind textBox.rawText.length() == 0 } ] } } }
  • 27. Ex04_InputButton.fx var textBox: TextBox; • Object Stage { scene: Scene { content: Flow { content: [ textBox = TextBox {} Button { text: "Submit" • disable: bind textBox.rawText.length() == 0 } • ] • } } }
  • 28. Ex04_InputButton.fx var textBox: TextBox; Stage { scene: Scene { content: Flow { content: [ textBox = TextBox {} Button { text: "Submit" disable: bind textBox.rawText.length() == 0 } ] • bind } } }
  • 30. Duration ms, s, m, h var x = 10ms; // 10s, 1m, 2h... var x2 = x * 200; // 2,000ms = 2s var x3 = x2 / 2; // 1s if (x2 < x3) ....
  • 31. Timeline 0s stop > play > stop
  • 32. KeyFrame Timeline 0s, 10s, 20s... x=10, x=30, x=100...
  • 33. Tween x KeyFrame 100 Easein Liner 30 Easeout 0 0s 10s 20s 10s 1
  • 34. Ex05_Timeline.fx var x = 0.0; var ball: Circle; Stage { title : "Ex05_Timeline" scene: Scene { width: 200 height: 200 content: ball = Circle { layoutX: bind x, layoutY: bind 0.005 * x * x radius: 5, fill: Color.BLUE } } }
  • 35. Ex05_Timeline.fx Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ KeyFrame { time: 0s values: [x => 0] } KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }.play();
  • 36. Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ • KeyFrame { time: 0s values: [x => 0] } KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }.play();
  • 37. KeyFrame Timeline { • repeatCount: Timeline.INDEFINITE keyFrames: [ •time KeyFrame { • KeyFrame time: 0s values: [x => 0] } KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }.play();
  • 38. Tween Timeline { •KeyFrame repeatCount: Timeline.INDEFINITE keyFrames: [ •x Linier KeyFrame { time: 0s values: [x => 0] } KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }.play();
  • 39. play Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ KeyFrame { • time: 0s values: [x => 0] } • orz KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }.play();
  • 40. OK var timeline = Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ KeyFrame { • time: 0s play values: [x => 0] } • Timeline KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] } ] }; timeline.play();
  • 41. at Timeline { •KeyFrame repeatCount: Timeline.INDEFINITE keyFrames: [ at(0s { x=> 0}) at(10s { x=> 200 tween Interpolator.LINEAR}) ] }.play();
  • 42. action Timeline { repeatCount: Timeline.INDEFINITE keyFrames: [ KeyFrame { time: 0s values: [x => 0] } KeyFrame { time: 10s values: [x => 200 tween Interpolator.LINEAR] action: function() { println(“end”); } } ] • }.play(); •at