SlideShare a Scribd company logo
Язык JavaFX Script –
разработка приложений
   Александр Щербатый




Developer/Community Campaign   Sun Proprietary/Confidential: Internal Use Only   1
JavaFX Script
JavaFX Script – это декларативный язык,
ориентированный на создание клиентских,
мобильных и веб медиа приложений
 Media приложения
• Анимация
• Видео
• Аудио


                   2
Декларативный синтаксис

Stage {
  title: "JavaFX Application"
  scene: Scene {
      content: Text {
         x: 10, y: 30
         font: Font { size: 34 }
         fill: Color.DARKBLUE
         content: "Hello World!"
         effect: DropShadow { offsetY: 3 }
      }
  }
}
                            3
Привязка данных – data binding
var saturation = 0.0;

CustomSlider {
   value: bind saturation with inverse
   minValue: -1.0
   maxValue: 1.0
 },
 ImageView {
     image: Image {
         url: "{__DIR__}/giraffe.jpg"
     }
     effect: ColorAdjust {
        saturation: bind saturation
     }
 },                                   4
Обработка событий


CustomButton {
  action: function() {
    println("Hello World!")
  }
}




                          5
Графические объекты


• Фигуры

• Градиенты




              6
Графические эффекты
●
  Затенение
●
  Смешение
●
  Наложение
●
  Отражение
●
  Размытость
●
  Подсветка
●
  Трансформация
●
  Сепия-тонирование



                      7
Функции
function f(x:Number):Number{
   Math.cos(x);
}

function integral( f: function(Number):Number,
                  a:Number, b: Number, dx: Number):Number{
   var s = 0.0;
   for(x in [a..b step dx]){
      s += f(x) * dx;
   }
   return s;
}

println( integral(f, -Math.PI /2, Math.PI/2, 0.01) );

// output: 1.9999900283082478
График Функции

function sqr(x:Number):Number { x * x }

FunctionGraph {
    xMin: -2
    xMax: 2
    scale: scale
    dx: dx
    color: Color.RED
    func: sqr
}

                          9
Последовательности
var seq = [ 2, 3, 4, 5 ];
var sqr = for(n in seq) n * n;
insert 1 into seq;
insert 9 after seq[3];
delete seq[ 0 ];
function factors(N:Integer):Integer[] {
  [ 1 .. N / 2 ] [n| N mod n == 0]
}
                            10
Интеграция с Java
import java.util.Date;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.text.Text;
var date = new Date();
Stage{
  title: "Date Example"
  scene: Scene{
  content: Text {
         x: 10 y: 30
         content: "Date: {%tF date}"
      }
  }
}                          11
Анимация

var car = Car{ };
var angle = 0;

Timeline {
  repeatCount: Timeline.INDEFINITE
  keyFrames: [
    KeyFrame {
       time: 0.1s
       values: angle => 180 tween Interpolator.LINEAR
       action: function() {
           car.move();
       }
    }
  ]
}                              12
Media компоненты

Stage {
  title: "Simple Media Player"
  scene: Scene{
      content: MediaComponent {
            mediaSourceURL: mediaUrl
            volume: 0.5
            visible:true
            mediaPlayerAutoPlay: true
         }
  }
}

                         13
Планетарная система
var planets = [
   Planet{
      name: "Mercury"
      radius: 0.383
      eccentricity: 0.20563
   },
   Planet{
      name: "Venus"
      radius: 0.95
      eccentricity: 0.0068
   },
   Planet{
      name: "Earth"
      radius: 1
      eccentricity: 0.01671
   }
];
                              14
Столкновение частиц
class Particle extends CustomNode {
   var radius : Number;

    public override function create(): Node {
      Circle {
         radius: bind radius
         fill: RadialGradient {
              centerX: 75
              centerY: 75
              radius: 90
              proportional: false
              stops: [
                 Stop { offset: 0.0 color: Color.RED },
                 Stop { offset: 1.0 color: Color.DARKRED }
              ]
         }
         effect: Reflection{ }
      }
    }
}                                     15
Среда разработки - NetBeans




               16
Ссылки
• http://java.sun.com/javafx
• http://developers.sun.ru/javafx
• http://ru.jfx.wikia.com

Форум
http://developers.sun.ru/forum

Среда разработки
http://javafx.netbeans.org

                                 17
Александр Щербатый




Developer/Community Campaign   Sun Proprietary/Confidential: Internal Use Only   18

More Related Content

Viewers also liked (14)

PDF
Air Pollution and Health Impacts
SSA KPI
 
PDF
Crowd Dynamics
SSA KPI
 
PDF
Nonlinear transport phenomena: models, method of solving and unusual features...
SSA KPI
 
PDF
Optimization in Crowd Movement Models via Anticipation
SSA KPI
 
PDF
Trade Theories. Appendix A
SSA KPI
 
PDF
Finding the Source of Sound
SSA KPI
 
PDF
Portfolio Theory
SSA KPI
 
PDF
Introduction to Modern Methods and Tools for Biologically Plausible Modelling...
SSA KPI
 
PDF
Sun Small Programmable Object Technology (Sun SPOT)
SSA KPI
 
PDF
Modelling of Future Geopolitical World Situations
SSA KPI
 
PDF
WebSphere
SSA KPI
 
PDF
Java Persistence API (JPA) Basics
SSA KPI
 
PDF
System Analysis, Foresees and Management of E-Services Impacts on Information...
SSA KPI
 
PDF
Logistics. Example
SSA KPI
 
Air Pollution and Health Impacts
SSA KPI
 
Crowd Dynamics
SSA KPI
 
Nonlinear transport phenomena: models, method of solving and unusual features...
SSA KPI
 
Optimization in Crowd Movement Models via Anticipation
SSA KPI
 
Trade Theories. Appendix A
SSA KPI
 
Finding the Source of Sound
SSA KPI
 
Portfolio Theory
SSA KPI
 
Introduction to Modern Methods and Tools for Biologically Plausible Modelling...
SSA KPI
 
Sun Small Programmable Object Technology (Sun SPOT)
SSA KPI
 
Modelling of Future Geopolitical World Situations
SSA KPI
 
WebSphere
SSA KPI
 
Java Persistence API (JPA) Basics
SSA KPI
 
System Analysis, Foresees and Management of E-Services Impacts on Information...
SSA KPI
 
Logistics. Example
SSA KPI
 

Similar to JavaFX Script Language (20)

PDF
JavaFX 2.0 overview
Dmitry Buzdin
 
PDF
Flex 4 Gumbo Framework
Mr_Dr_Jr
 
PDF
2015-12-05 Сергей Аверин - Javascript-фреймворки: должен остаться только один
HappyDev
 
PDF
SECON'2016. Сергей Аверин. Javascript-фреймворки:
 должен остаться только один
SECON
 
PDF
SECON'2016. Аверин Сергей, Javascript-фреймворки:
 должен остаться только один
SECON
 
PDF
Javascript-фреймворки:
 должен остаться только один
Sergey Xek
 
PDF
Javascript-фреймворки: должен остаться только один / Аверин Сергей (Acronis)
Ontico
 
KEY
Flex 4 gumbo framework
Valery
 
PPTX
Дуров Р. - Cocos2d
Innim
 
PDF
Lime.JS
Pavlo Iuriichuk
 
PDF
Design Platform FrontendConf
Alexander Lobashev
 
PPTX
Компонент-платформа / Александр Лобашев (Avito)
Ontico
 
PDF
Компонентный подход: скучно, неинтересно, бесперспективно
Roman Dvornov
 
PDF
Антон Корзунов "Графика на карте в API 2.0"
Yandex
 
PDF
basis.js - почему я не бросил разрабатывать свой фреймворк
Roman Dvornov
 
PDF
Information system structure and architecture
Timur Shemsedinov
 
PDF
Марина Степанова "Как мы заставили API Яндекс.Карт работать быстрее"
Yandex
 
PDF
Dart - светлая сторона силы?
Mikhail Davydov
 
PPTX
JavaScript Design Patterns overview by Ksenia Redunova
Lohika_Odessa_TechTalks
 
PPSX
создание HTML игр на элементе canvas
Alexander Samantsov
 
JavaFX 2.0 overview
Dmitry Buzdin
 
Flex 4 Gumbo Framework
Mr_Dr_Jr
 
2015-12-05 Сергей Аверин - Javascript-фреймворки: должен остаться только один
HappyDev
 
SECON'2016. Сергей Аверин. Javascript-фреймворки:
 должен остаться только один
SECON
 
SECON'2016. Аверин Сергей, Javascript-фреймворки:
 должен остаться только один
SECON
 
Javascript-фреймворки:
 должен остаться только один
Sergey Xek
 
Javascript-фреймворки: должен остаться только один / Аверин Сергей (Acronis)
Ontico
 
Flex 4 gumbo framework
Valery
 
Дуров Р. - Cocos2d
Innim
 
Design Platform FrontendConf
Alexander Lobashev
 
Компонент-платформа / Александр Лобашев (Avito)
Ontico
 
Компонентный подход: скучно, неинтересно, бесперспективно
Roman Dvornov
 
Антон Корзунов "Графика на карте в API 2.0"
Yandex
 
basis.js - почему я не бросил разрабатывать свой фреймворк
Roman Dvornov
 
Information system structure and architecture
Timur Shemsedinov
 
Марина Степанова "Как мы заставили API Яндекс.Карт работать быстрее"
Yandex
 
Dart - светлая сторона силы?
Mikhail Davydov
 
JavaScript Design Patterns overview by Ksenia Redunova
Lohika_Odessa_TechTalks
 
создание HTML игр на элементе canvas
Alexander Samantsov
 
Ad

More from SSA KPI (20)

PDF
Germany presentation
SSA KPI
 
PDF
Grand challenges in energy
SSA KPI
 
PDF
Engineering role in sustainability
SSA KPI
 
PDF
Consensus and interaction on a long term strategy for sustainable development
SSA KPI
 
PDF
Competences in sustainability in engineering education
SSA KPI
 
PDF
Introducatio SD for enginers
SSA KPI
 
PPT
DAAD-10.11.2011
SSA KPI
 
PDF
Talking with money
SSA KPI
 
PDF
'Green' startup investment
SSA KPI
 
PDF
From Huygens odd sympathy to the energy Huygens' extraction from the sea waves
SSA KPI
 
PDF
Dynamics of dice games
SSA KPI
 
PPT
Energy Security Costs
SSA KPI
 
PPT
Naturally Occurring Radioactivity (NOR) in natural and anthropic environments
SSA KPI
 
PDF
Advanced energy technology for sustainable development. Part 5
SSA KPI
 
PDF
Advanced energy technology for sustainable development. Part 4
SSA KPI
 
PDF
Advanced energy technology for sustainable development. Part 3
SSA KPI
 
PDF
Advanced energy technology for sustainable development. Part 2
SSA KPI
 
PDF
Advanced energy technology for sustainable development. Part 1
SSA KPI
 
PPT
Fluorescent proteins in current biology
SSA KPI
 
PPTX
Neurotransmitter systems of the brain and their functions
SSA KPI
 
Germany presentation
SSA KPI
 
Grand challenges in energy
SSA KPI
 
Engineering role in sustainability
SSA KPI
 
Consensus and interaction on a long term strategy for sustainable development
SSA KPI
 
Competences in sustainability in engineering education
SSA KPI
 
Introducatio SD for enginers
SSA KPI
 
DAAD-10.11.2011
SSA KPI
 
Talking with money
SSA KPI
 
'Green' startup investment
SSA KPI
 
From Huygens odd sympathy to the energy Huygens' extraction from the sea waves
SSA KPI
 
Dynamics of dice games
SSA KPI
 
Energy Security Costs
SSA KPI
 
Naturally Occurring Radioactivity (NOR) in natural and anthropic environments
SSA KPI
 
Advanced energy technology for sustainable development. Part 5
SSA KPI
 
Advanced energy technology for sustainable development. Part 4
SSA KPI
 
Advanced energy technology for sustainable development. Part 3
SSA KPI
 
Advanced energy technology for sustainable development. Part 2
SSA KPI
 
Advanced energy technology for sustainable development. Part 1
SSA KPI
 
Fluorescent proteins in current biology
SSA KPI
 
Neurotransmitter systems of the brain and their functions
SSA KPI
 
Ad

JavaFX Script Language