Skip to content

Silveira Neto Posts

Draggable and Growable Ball in JavaFX

Two simple JavaFX code handling onMouseDragged event.

import javafx.ui.*;
import javafx.ui.canvas.*;

Canvas {
    content: Circle {
        var x = 50
        var y = 50
        transform: bind translate(x, y)
        radius: 30
        fill: red
        onMouseDragged: operation(e) {
                x += e.localDragTranslation.x;
                y += e.localDragTranslation.y;

        }
    }
}

import javafx.ui.*;
import javafx.ui.canvas.*;

Canvas {
    content: Circle {
        var x = 50
        var y = 50
        var radius = 30
        transform: bind translate(x, y)
        radius: bind radius
        fill: red
        onMouseDragged: operation(e) {
            if (e.button == 1){
                x += e.localDragTranslation.x;
                y += e.localDragTranslation.y;
            }
            if (e.button == 3) {
                radius += e.localDragTranslation.x;
            }
        }
    }
}

import javafx.ui.*;
import javafx.ui.canvas.*;

Canvas {
    content: [
    Rect {x: 50, y: 50, width: 50, height: 50, fill: orange },
    Circle {
        var x = 50
        var y = 50
        var radius = 30
        var color = red:Color
        transform: bind translate(x, y)
        radius: bind radius
        fill: bind color
        onMouseDragged: operation(e) {
            if (e.button == 1){
                x += e.localDragTranslation.x;
                y += e.localDragTranslation.y;
            }
            if (e.button == 3) {
                radius += e.localDragTranslation.x;
            }
        }
        onMousePressed: operation(e){
            color = Color {blue: 0.0, green: 0.0, red: 1.0, opacity: 0.5};
        }
        onMouseReleased: operation(e){
            color = red:Color;
        }
    }]
}

You can test this examples with thhe JavaFX Pad or using Netbeans with the JavaFX Plugin.

Almoço na IBM e os cartões perfurados

Hoje eu almocei com o Antonio Junior que trabalha, que eu conhecei através do blog, na sede da IBM Brasil.

IBM
Prédio da IBM Brasil. Enorme!
 

IBM

E ainda visitei um pequeno museu de computadores da IBM e vi várias máquina jurássicas, dessas de perfurar cartões.

IBM

IBM

IBM

IBM

E de brinde esse imenso disco rígido de 1,8 gigas!

IBM

Reggie and Simon here in Fortaleza

Reginald (Reggie) Hutcherson is the manager of the Sun Technology Evangelism group. Simon Ritter is a Java Technology Evangelist at Sun Microsystems. They were here in Brazil to some events and we bring them to Fortaleza (Ceará) to talk too in our local jug event (Café com Tapioca de Coco).

Plaquinha
Sign we made to find them in the airport.

Airport

Me and Rafael got them in the airport and showed some some cool places in the city. They already knew what they wanted to eat: barbecue!

Simon Ritter

Reggie and Simon
Reggie, me, Rafael and Simon.

They are really cool guys. Soon I’ll put some photos of event itself.

Unfortunately I could not stay for the event due my flight to São Paulo in order to be in the Campus Party Brasil 2008.