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

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

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