Sunday, April 8, 2012

JavaFX 2: transform of Shear

JavaFX 2: transform of Shear

package javafx_transform;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.transform.Shear;
import javafx.stage.Stage;

/**
*
* @web http://java-buddy.blogspot.com/
*/
public class JavaFX_Transform extends Application {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("java-buddy.blogspot.com");
Group root = new Group();
Scene scene = new Scene(root, 300, 250);

Rectangle rect = new Rectangle(100, 100, Color.RED);
rect.getTransforms().add(new Shear(0.5, 0));; //Shear(double x, double y)

root.getChildren().add(rect);
primaryStage.setScene(scene);
primaryStage.show();
}
}

No comments:

Post a Comment

Post a Comment