Java Reference
In-Depth Information
public function doReplace(nodeToReplace:Node,replacementNode:Node,doAfter:function()):Void{
var parent:Group = (nodeToReplace.parent as Group);
var index = Sequences.indexOf(parent.content, nodeToReplace);
var startingX = nodeToReplace.translateX;
var startingY = nodeToReplace.translateY;
var minX = nodeToReplace.boundsInLocal.minX;
var minY = nodeToReplace.boundsInLocal.minY;
var startWidth = nodeToReplace.boundsInLocal.width;
var startHeight = nodeToReplace.boundsInLocal.height;
delete nodeToReplace from parent.content;
nodeToReplace.translateX = 0;
nodeToReplace.translateY = 0;
var radius = startWidth/2.0;
var angle = 0.0;
var back = startHeight/10.0;
// The following four lines were was inspired by Josh Marinacci
// http://javafx.com/samples/DisplayShelf/index.html
var lx = bind radius - Math.sin(Math.toRadians(angle))*radius;
var rx = bind radius + Math.sin(Math.toRadians(angle))*radius;
var uly = bind 0 - Math.cos(Math.toRadians(angle))*back;
var ury = bind 0 + Math.cos(Math.toRadians(angle))*back;
var perspective = PerspectiveTransform{
ulx: bind lx
uly: bind uly
urx: bind rx
ury: bind ury
lrx: bind rx
lry: bind startHeight + uly
llx: bind lx
lly: bind startHeight + ury
}
var holder = Group{
translateX: startingX + minX
translateY: startingY + minY
content: [nodeToReplace]
effect: perspective
}
Search WWH ::




Custom Search