About this siteFeed sources and resources
unknown (71)
2008 November 20 (9)2008 November 19 (3)2008 November 18 (2)2008 November 17 (5)2008 November 16 (1)2008 November 14 (3)2008 November 13 (3)2008 November 12 (3)2008 November 11 (10)2008 November 10 (6)2008 November 09 (1)2008 November 08 (4)2008 November 07 (2)2008 November 06 (6)2008 November 05 (3)2008 November 04 (3)2008 November 01 (1)2008 November 03 (1)
2008 October 31 (2)2008 October 29 (2)2008 October 28 (3)2008 October 27 (4)2008 October 26 (1)2008 October 24 (2)2008 October 22 (4)2008 October 21 (4)2008 October 20 (5)2008 October 17 (2)2008 October 16 (2)2008 October 15 (3)2008 October 14 (2)2008 October 13 (2)2008 October 11 (1)2008 October 10 (2)2008 October 08 (2)2008 October 07 (2)2008 October 06 (2)2008 October 03 (2)2008 October 01 (2)2008 October 23 (1)2008 October 09 (1)2008 October 02 (1)
2008 September 26 (2)2008 September 25 (3)2008 September 24 (2)2008 September 21 (2)2008 September 16 (1)2008 September 13 (1)2008 September 12 (9)2008 September 11 (10)2008 September 10 (6)2008 September 09 (7)2008 September 08 (5)2008 September 07 (2)2008 September 06 (3)2008 September 05 (6)2008 September 04 (7)2008 September 03 (5)2008 September 02 (4)2008 September 01 (6)2008 September 30 (1)2008 September 29 (1)2008 September 23 (1)2008 September 22 (1)2008 September 19 (1)2008 September 18 (1)
2008 August 31 (4)2008 August 30 (2)2008 August 29 (9)2008 August 28 (6)2008 August 27 (21)2008 August 26 (9)2008 August 25 (7)2008 August 24 (3)2008 August 23 (2)2008 August 22 (8)2008 August 21 (18)2008 August 20 (14)2008 August 19 (21)2008 August 18 (16)2008 August 17 (8)2008 August 16 (9)2008 August 15 (6)2008 August 14 (10)2008 August 13 (13)2008 August 12 (12)2008 August 11 (13)2008 August 10 (6)2008 August 09 (6)2008 August 08 (7)2008 August 07 (15)2008 August 06 (15)2008 August 05 (24)2008 August 04 (65)2008 August 03 (19)2008 August 02 (23)2008 August 01 (62)
2008 July 31 (87)2008 July 30 (12)2008 July 29 (10)2008 July 28 (4)2008 July 27 (13)2008 July 26 (3)2008 July 25 (3)2008 July 24 (2)2008 July 23 (4)2008 July 22 (11)2008 July 21 (1)2008 July 20 (20)2008 July 19 (3)2008 July 18 (3)2008 July 17 (5)2008 July 16 (6)2008 July 15 (14)2008 July 14 (8)2008 July 13 (2)2008 July 12 (2)2008 July 11 (5)2008 July 10 (17)2008 July 09 (1)2008 July 08 (6)2008 July 07 (11)2008 July 06 (1)2008 July 05 (4)2008 July 03 (5)2008 July 02 (3)2008 July 01 (14)

Berlin conferences: Berlin.jar and OSiM World  (weblogs.java.net)  

It's been nice and quiet for a couple of weeks - no travel. Now the conference circuit is starting up again and so in a couple of days I will head up to Berlin, Germany for two conferences: Berlin.jar is...

Sunday work - Tracing in FX and Blog Change :-)  (blogs.sun.com)  

 I did some fine tuning in my blog page after long time :-). I have added two more link in Links section, which can be helpful in :

1. Telling which JRE's are there on your machine(blog readers) machine.

2. And second will install the latest JRE(It will start installation directly, so careful :-D)

Alright, So now again one post for JavaFX. Finally I am able to write tracing path code in JavaFX. I have seen this in lot of Physics Motions where they show motion with tracing effect. Have a look at the output :

Here the ball is moving in a cosine fashion and so the trace. Easiest way to achieve this is to write code in update method. Have a look on the code, its small:

package tracemotion;

import javafx.scene.Node;
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.application.Frame;
import javafx.application.Stage;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.scene.geometry.*;
import javafx.scene.effect.*;
import javafx.scene.paint.*;

import java.lang.System;
import java.lang.Math;

var t : Number = 0.0;

Frame {
    var input : TracingBall = TracingBall {};
    stage : Stage {
        fill: Color.BLACK;
        content : bind [
            input
        ]
    }
 
    visible : true
    title : "Tracing Ball"
    width : 600
    height : 600
    closeAction : function() { java.lang.System.exit( 0 ); }
}

class TracingBall extends CustomNode {

    attribute tracingballs : Circle[];
    attribute length : Integer = 600;
    attribute timer : Timeline = Timeline {
        repeatCount: Timeline.INDEFINITE
        keyFrames :
            KeyFrame {
                time : 100ms
                action : function() {
                    update();
                    t = t+0.3;
                }
            }
    }
 public function update() : Void {
        for( i in [0..length - 30] ) {
            tracingballs[i].centerX = tracingballs[i+30].centerX;
            tracingballs[i].centerY = tracingballs[i+30].centerY;
            tracingballs[i].radius = tracingballs[i+30].radius;
            tracingballs[i].opacity=0.4;
        }
        tracingballs[length] = Circle {
           centerX : bind(100 + t * 30), 
           centerY : (300 + Math.cos(t) * 100), 
           radius : 30, 
           fill : bind LinearGradient {
                    proportional: true
                    stops: [
                        Stop { offset: 0.0 color: Color.RED },
                        Stop { offset: 1.0 color: Color.GAINSBORO },
                    ]
                },
           opacity : 1.0 
 
        };
 }
 public function create(): Node {
        return Group {
            content : bind[tracingballs]   
        };
 }
 init {
        for( i in [0..length] ) {
            insert Circle { fill : bind LinearGradient {
                    proportional: true
                    stops: [
                        Stop { offset: 0.0 color: Color.RED },
                        Stop { offset: 1.0 color: Color.GAINSBORO },
                    ]
                },
                } into tracingballs;
 
        }   
        timer.start();
    }        
}
Some lines in code are filling those fancy colors in ball(some lines are hard coded as well).I am a real bad guy in filling nice catchy colors(this color looks like a sun and a moon combination). Any comments/improvements are welcome !