lundi 25 janvier 2010

Eclipse et Ubuntu 9.10 …

Au départ, je voulais juste installer le plugin Android avec la dernière version d’Eclipse(3.5.1) sur mon Ubuntu 9.10. 
La chose parait assez simple de premier abord…
Mais impossible d’installer le plugin, les boutons ne produisent aucune action, les listes ne s’affichent pas, etc…
La cause du problème provient d’Eclipse qui utilise la bibliothèque UI SWT se basant les composants UI natif  GTK+
et comme le comportement interne de GTK+ a changé dans la version de GTK+ (2.18) utilisée dans Ubuntu 9.10 et que SWT utilise très mal et bidouille trop GTK+, ca ne marche plus.
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/442078/comments/28

Heureusement les créateurs on prévu le coup et il existe une variable pour redonner le comportement d’avant avec cette version de GTK+.
La solution est donc de créer un script  pour lancer Eclipse avec la variable GDK_NATIVE_WINDOWS positionnée à  1
launch_eclipse.sh
#!/bin/bash
export  GDK_NATIVE_WINDOWS=1
/home/patrick/patrick/program/eclipse.org/eclipse-javaEE-galileo/eclipse/eclipse
Ou /home/patrick/patrick/program/eclipse.org/eclipse-javaEE-galileo/eclipse/eclipse est l’emplacement de votre exécutable Eclipse

Sinon NetBeans fonctionne très bien ;)
Note : Le problème existe aussi avec toutes les applications Eclipse RCP et je pense SWT

dimanche 10 janvier 2010

Scrolling with DisplacementMap effect

Bonne Année ! , Happy New Year !

For beginning this New Year, I added a sinusoidal effect to my scroll.
To do that, I added a
DisplacementMap effect to the scroll line.

DisplacementMap Effect
                    effect: DisplacementMap { mapData: map
                                              input:Reflection {
                                                   fraction: 0.75
                                                   topOffset: 0.0
                                                   topOpacity: 0.5
                                                   bottomOpacity: 0.0
                                               } 
                  } 

And I created a FloatMap to make the sinusoidal effect

FloatMap
var widthScroll = letterWidth * 10;    // 10 chars
var map = FloatMap { width: widthScroll height: letterHeight }
for (i:Integer in [0..<widthScroll]) {
    var v = (Math.sin(i/35.0*Math.PI)-0.5)/30.0;
    for (j:Integer in [0..<letterHeight]) {
        map.setSamples(i, j, 0.0, v);
    }
}
As you see in the code, the DisplacementMap effect take a FloatMap as parameter. And each individual entry in the FloatMap contains per-pixel offset information in the x and y direction.

For example if you have this image

My FloatMap contains offsets x and y to have

Download full Main.fx

Download StringConverter.fx