Hi Kai
You can find the following example of shell-level fading in [1]:
Timeline fadeInShellTimeline = new Timeline(shell);
fadeInShellTimeline.addPropertyToInterpolate("alpha", 0, 255);
fadeInShellTimeline.setDuration(500);
fadeInShellTimeline.play();
It uses the Trident capabilities along with the SWT Shell.setAlpha API to fade in the window previously displayed with
shell.setAlpha(0);
shell.open();
My first thought was to provide a Shell extension class that has this built in (by overriding the dispose and open methods). Unfortunately, the Shell class can only be extended in the same package - unlike Swing that lets you extend the top-level window classes. While this seems logical for other tasks, the fade-in / fade-outs of SWT windows need to be explicit. You can find the helper method that fades out an SWT shell (and the disposes it once it reached the alpha of 0) in GraniteUtils.fadeOutAndDispose method:
public static void fadeOutAndDispose(final Shell shell, int fadeOutDuration) {
Timeline dispose = new Timeline(shell);
dispose.addPropertyToInterpolate("alpha", 255,
0);
dispose.addCallback(new UIThreadTimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(TimelineState oldState,
TimelineState newState, float durationFraction,
float timelinePosition) {
if (newState == TimelineState.DONE) {
shell.dispose();
}
}
});
dispose.setDuration(fadeOutDuration);
dispose.play();
}
As to the animated splash screens - Trident gives you the ability to interpolate fields that control the animation, and you will need to provide custom painting based on the current values of those fields. You can see a (relatively) simple example at [2].
Thanks
Kirill
[1] http://www.pushing-pixels.org/?p=1367[2]
http://www.pushing-pixels.org/?p=1370