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

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

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