1 / 16

Язык JavaFX Script – разработка приложений

Язык JavaFX Script – разработка приложений. Александр Щербатый. JavaFX Script. Анимация Видео Аудио. JavaFX Script – это декларативный язык, ориентированный на создание клиентских, мобильных и веб медиа приложений. Media приложения. 2. Декларативный синтаксис. Stage {

varana
Download Presentation

Язык JavaFX Script – разработка приложений

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Язык JavaFX Script – разработка приложений • Александр Щербатый

  2. JavaFX Script Анимация Видео Аудио JavaFX Script – это декларативный язык, ориентированный на создание клиентских, мобильных и веб медиа приложений Media приложения 2

  3. Декларативный синтаксис 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

  4. Привязка данных – 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

  5. Обработка событий CustomButton { action: function() { println("Hello World!")‏ } } 5

  6. Функции functionf(x:Number):Number{ Math.cos(x); } functionintegral( 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.999990028308247 6

  7. График Функции functionsqr(x:Number):Number { x * x } FunctionGraph { xMin: -2 xMax: 2 scale: scale dx: dx color: Color.RED func: sqr } 7

  8. Графические объекты Фигуры Градиенты 8

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

  10. Анимация 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(); } } ] } 10

  11. Media компоненты Stage { title: "Simple Media Player" scene: Scene{ content: MediaComponent { mediaSourceURL: mediaUrl volume: 0.5 visible:true mediaPlayerAutoPlay: true } } } 11

  12. Планетарная система 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 } ]; 12

  13. Столкновение частиц class Particle extends CustomNode { varradius : Number; public override functioncreate(): 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{ } } } } 13

  14. Среда разработки - NetBeans 14

  15. Ссылки http://java.sun.com/javafx http://developers.sun.ru/javafx http://ru.jfx.wikia.com Форум http://developers.sun.ru/forum Среда разработки http://javafx.netbeans.org 15

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

More Related