Sunday, February 15, 2009
Java FX
http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp
Verify Java WebStart is installed on my system.
Make sure that Java Web Start is installed on the client system.
import javafx.ui.*;
import javafx.ui.canvas.*;
import javafx.ui.filter.*;
Group {
var x = 0
var y = 0
var alpha = 1
transform: bind translate(x, y)
opacity: bind alpha
onMouseDragged: operation(e) {
// updating x and y will move the group
// since a translation transform is bound to them
x += e.localDragTranslation.x;
y += e.localDragTranslation.y;
}
onMouseClicked: operation(e) {
// updating alpha will fade the group
// since the opacity of the group is bound to it
if (alpha == 1) {
alpha = [0, 1] dur 1000 motion EASEBOTH;
}
}
toolTipText: "Click to fade, or drag to move rectangle"
content:
[Rect {
cursor: HAND
selectable: true
x: 10
y: 10
width: 385
height: 220
fill: LinearGradient {
x1: 0
y1: 0
x2: 1
y2: 0
stops:
[Stop {offset: 0, color: gray},
Stop {offset: .5, color: new Color(.8, .8, .8, 1)},
Stop {offset: 1, color: gray}]
}
stroke: black
strokeWidth: 1
},
Group {
function filt(color:Color, bump:Number, intensity:Number, burstFactor:Number) =
[ShapeBurst {factor: burstFactor},
LightFilter {
highlight: 3
viewDistance: 300
diffuseColor: color
bumpSoftness: bump
light: AmbientLight {intensity: intensity}
}];
content: [
Group {
filter: ShadowFilter {x: 10, y: -9, distance: 10 shadowColor: black, opacity: 0.7 }
content: [
Rect {height: 150, width: 210, transform: scale(2, 2)},
Path {
d: [
MoveTo {
x: 50.0
y: 90.0
absolute: true
},
CurveTo {
x1: 0.0
y1: 90.0
x2: 0.0
y2: 30.0
x3: 50.0
y3: 30.0
smooth: false
absolute: true
},
LineTo {
x: 150.0
y: 30.0
absolute: true
},
CurveTo {
x1: 200.0
y1: 30.0
x2: 200.0
y2: 90.0
x3: 150.0
y3: 90.0
smooth: false
absolute: true
},
ClosePath {},
]
stroke: rgba(0xD9, 0x00, 0x00, 0xff)
strokeWidth: 10.0
transform: scale(2, 2)
filter: valueof filt(red:Color, 6, .5, 4)
},
Path {
d: [
MoveTo {
x: 60.0
y: 80.0
absolute: true
},
CurveTo {
x1: 30.0
y1: 80.0
x2: 30.0
y2: 40.0
x3: 60.0
y3: 40.0
smooth: false
absolute: true
},
LineTo {
x: 140.0
y: 40.0
absolute: true
},
CurveTo {
x1: 170.0
y1: 40.0
x2: 170.0
y2: 80.0
x3: 140.0
y3: 80.0
smooth: false
absolute: true
},
ClosePath {},
]
fill: rgba(0xD9, 0x00, 0x00, 0xff)
transform: scale(2, 2)
filter: valueof filt(red:Color, 5, .5, 7)
},
Group {
content: [
Text {
verticalAlignment: BASELINE
content: 'JavaFX'
font: Font {faceName: 'Verdana', style: BOLD, size: 25.0}
fill: white
x: 50.0
y: 69.0
transform: scale(2, 2)
filter: [ShadowFilter {x: 5, y: -5, distance: 3, shadowColor:black opacity: 0.8}]
}]
}]
}]
}]
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment