/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Oracle Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* DialInterface.fx
*
* Created on Apr 24, 2009, 10:55:22 PM
*/package fxaddressbook;
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.animation.Interpolator;
import javafx.scene.shape.Circle;
//@author JavaFX Samples Team// Interface for Dialing Phone no.
public class DialInterface extends CustomNode {
varcircle1:Circle = null;
varcircle2:Circle = null;
varcircle3:Circle = null;
varphoneNumber:String = null;
varalertColor:Color = Color.WHITE;
varmessage:String = "This is an interface only !";
vargrDialing:Group = Group {
translateX: 50translateY: 70content: [
//Dialing text with animation.
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 15
}
x: 0y: 20content: "Dialing"
}
circle1 = Circle {
visible: false
centerX: 50,
centerY: 15radius: 2fill: Color.WHITE
}
circle2 = Circle {
visible: false
centerX: 60,
centerY: 15radius: 2fill: Color.WHITE
}
circle3 = Circle {
visible: false
centerX: 70,
centerY: 15radius: 2fill: Color.WHITE
}
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 13
}
x: 0y: 40content: bind phoneNumber
}
]
}
vargrAlert:Group = Group{
translateX: 50translateY: 200content: [
Text {
fill: bind alertColor
font:Font {
size: 12name: "Arial Bold"
}
textAlignment: TextAlignment.CENTER
content: message
}
]
}
public function showPhone(ph:String):Void{
this.phoneNumber = ph;
}
public function startDialing():Void{
Timeline {
repeatCount: 1keyFrames: [
KeyFrame {
time: 0s
action:function(){
dialTime.playFromStart();
grAlert.visible = false;
}
},
KeyFrame {
time: 5s
action:function(){
dialTime.stop();
grAlert.visible = true;
alertTime.playFromStart();
}
}
]
}.playFromStart();
var dialTime = Timeline {
repeatCount: 20keyFrames: [
KeyFrame {
time: 300ms
values: [
circle1.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 600ms
values: [
circle2.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 900ms
values: [
circle3.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 1200ms
values: [
circle1.visible => false tween Interpolator.LINEAR,
circle2.visible => false tween Interpolator.LINEAR,
circle3.visible => false tween Interpolator.LINEAR
]
}
]
};
var alertTime = Timeline {
repeatCount: 10keyFrames: [
KeyFrame {
time: 250ms
action:function() {
alertColor = Color.GRAY
}
},
KeyFrame {
time: 500ms
action:function() {
alertColor = Color.WHITE
}
}
]
}
}
public override function create():Node {
return Group {
content: [
Rectangle {
x: 0y: 0width: 240height: 320fill: Color.BLACK
},
grAlert,
grDialing,
// Close button in title bar
Rectangle {
blocksMouse: true
x: 215y: 3arcHeight: 4arcWidth: 4width: 20height: 20stroke: Color.GRAY
strokeWidth: 2onMouseClicked:function(e:MouseEvent):Void {
this.visible = false;
}
}
// Close button 'x' in title bar
Text {
fill: Color.WHITE
font:Font {
name: "Arial Bold"size: 18
}
x: 220,
y: 19content: "x"
}
]
};
}
}
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Oracle Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* DialInterface.fx
*
* Created on Apr 24, 2009, 10:55:22 PM
*/package fxaddressbook;
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.animation.Interpolator;
import javafx.scene.shape.Circle;
//@author JavaFX Samples Team// Interface for Dialing Phone no.
public class DialInterface extends CustomNode {
varcircle1:Circle = null;
varcircle2:Circle = null;
varcircle3:Circle = null;
varphoneNumber:String = null;
varalertColor:Color = Color.WHITE;
varmessage:String = "This is an interface only !";
vargrDialing:Group = Group {
translateX: 50translateY: 70content: [
//Dialing text with animation.
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 15
}
x: 0y: 20content: "Dialing"
}
circle1 = Circle {
visible: false
centerX: 50,
centerY: 15radius: 2fill: Color.WHITE
}
circle2 = Circle {
visible: false
centerX: 60,
centerY: 15radius: 2fill: Color.WHITE
}
circle3 = Circle {
visible: false
centerX: 70,
centerY: 15radius: 2fill: Color.WHITE
}
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 13
}
x: 0y: 40content: bind phoneNumber
}
]
}
vargrAlert:Group = Group{
translateX: 50translateY: 200content: [
Text {
fill: bind alertColor
font:Font {
size: 12name: "Arial Bold"
}
textAlignment: TextAlignment.CENTER
content: message
}
]
}
public function showPhone(ph:String):Void{
this.phoneNumber = ph;
}
public function startDialing():Void{
Timeline {
repeatCount: 1keyFrames: [
KeyFrame {
time: 0s
action:function(){
dialTime.playFromStart();
grAlert.visible = false;
}
},
KeyFrame {
time: 5s
action:function(){
dialTime.stop();
grAlert.visible = true;
alertTime.playFromStart();
}
}
]
}.playFromStart();
var dialTime = Timeline {
repeatCount: 20keyFrames: [
KeyFrame {
time: 300ms
values: [
circle1.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 600ms
values: [
circle2.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 900ms
values: [
circle3.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 1200ms
values: [
circle1.visible => false tween Interpolator.LINEAR,
circle2.visible => false tween Interpolator.LINEAR,
circle3.visible => false tween Interpolator.LINEAR
]
}
]
};
var alertTime = Timeline {
repeatCount: 10keyFrames: [
KeyFrame {
time: 250ms
action:function() {
alertColor = Color.GRAY
}
},
KeyFrame {
time: 500ms
action:function() {
alertColor = Color.WHITE
}
}
]
}
}
public override function create():Node {
return Group {
content: [
Rectangle {
x: 0y: 0width: 240height: 320fill: Color.BLACK
},
grAlert,
grDialing,
// Close button in title bar
Rectangle {
blocksMouse: true
x: 215y: 3arcHeight: 4arcWidth: 4width: 20height: 20stroke: Color.GRAY
strokeWidth: 2onMouseClicked:function(e:MouseEvent):Void {
this.visible = false;
}
}
// Close button 'x' in title bar
Text {
fill: Color.WHITE
font:Font {
name: "Arial Bold"size: 18
}
x: 220,
y: 19content: "x"
}
]
};
}
}
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Oracle Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* DialInterface.fx
*
* Created on Apr 24, 2009, 10:55:22 PM
*/package fxaddressbook;
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.animation.Interpolator;
import javafx.scene.shape.Circle;
//@author JavaFX Samples Team// Interface for Dialing Phone no.
public class DialInterface extends CustomNode {
varcircle1:Circle = null;
varcircle2:Circle = null;
varcircle3:Circle = null;
varphoneNumber:String = null;
varalertColor:Color = Color.WHITE;
varmessage:String = "This is an interface only !";
vargrDialing:Group = Group {
translateX: 50translateY: 70content: [
//Dialing text with animation.
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 15
}
x: 0y: 20content: "Dialing"
}
circle1 = Circle {
visible: false
centerX: 50,
centerY: 15radius: 2fill: Color.WHITE
}
circle2 = Circle {
visible: false
centerX: 60,
centerY: 15radius: 2fill: Color.WHITE
}
circle3 = Circle {
visible: false
centerX: 70,
centerY: 15radius: 2fill: Color.WHITE
}
Text {
fill: Color.WHITE
font:Font {
name: "Arial"size: 13
}
x: 0y: 40content: bind phoneNumber
}
]
}
vargrAlert:Group = Group{
translateX: 50translateY: 200content: [
Text {
fill: bind alertColor
font:Font {
size: 12name: "Arial Bold"
}
textAlignment: TextAlignment.CENTER
content: message
}
]
}
public function showPhone(ph:String):Void{
this.phoneNumber = ph;
}
public function startDialing():Void{
Timeline {
repeatCount: 1keyFrames: [
KeyFrame {
time: 0s
action:function(){
dialTime.playFromStart();
grAlert.visible = false;
}
},
KeyFrame {
time: 5s
action:function(){
dialTime.stop();
grAlert.visible = true;
alertTime.playFromStart();
}
}
]
}.playFromStart();
var dialTime = Timeline {
repeatCount: 20keyFrames: [
KeyFrame {
time: 300ms
values: [
circle1.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 600ms
values: [
circle2.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 900ms
values: [
circle3.visible => true tween Interpolator.LINEAR
]
},
KeyFrame {
time: 1200ms
values: [
circle1.visible => false tween Interpolator.LINEAR,
circle2.visible => false tween Interpolator.LINEAR,
circle3.visible => false tween Interpolator.LINEAR
]
}
]
};
var alertTime = Timeline {
repeatCount: 10keyFrames: [
KeyFrame {
time: 250ms
action:function() {
alertColor = Color.GRAY
}
},
KeyFrame {
time: 500ms
action:function() {
alertColor = Color.WHITE
}
}
]
}
}
public override function create():Node {
return Group {
content: [
Rectangle {
x: 0y: 0width: 240height: 320fill: Color.BLACK
},
grAlert,
grDialing,
// Close button in title bar
Rectangle {
blocksMouse: true
x: 215y: 3arcHeight: 4arcWidth: 4width: 20height: 20stroke: Color.GRAY
strokeWidth: 2onMouseClicked:function(e:MouseEvent):Void {
this.visible = false;
}
}
// Close button 'x' in title bar
Text {
fill: Color.WHITE
font:Font {
name: "Arial Bold"size: 18
}
x: 220,
y: 19content: "x"
}
]
};
}
}