???? JavaFX Script - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

???? JavaFX Script

Description:

JavaFX Script JavaFX Script ... – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 17
Provided by: msintLoko8
Category:

less

Transcript and Presenter's Notes

Title: ???? JavaFX Script


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
???????
  • function f(xNumber)Number
  • Math.cos(x)
  • function integral( f function(Number)Number,
  • aNumber, 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
?????? ???????
  • function sqr(xNumber)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 gt 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
  • visibletrue
  • 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
  • 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

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
  • ????????? ????????
Write a Comment
User Comments (0)
About PowerShow.com