package test.multitouch.app; import javafx.animation.PathTransition; import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.scene.shape.LineTo; import javafx.scene.shape.MoveTo; import javafx.scene.shape.Path; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; import javafx.util.Duration; //import test.javaclient.shared.Utils; /** * * @author Taras Ledkov < taras.ledkov@oracle.com > */ public class MoveTextWithStrokeTest extends Application { //public class MultiTouchApp extends InteroperabilityApp { Scene scene; Group root = new Group(); // @Override protected Scene getScene() { scene = new Scene(root, 600, 600, Color.WHITE); final Text txt = new Text(200, 200, "JavaFX"); txt.setFont(new Font(20)); txt.setStrokeWidth(4); txt.setStroke(Color.BLACK); txt.setScaleX(6); txt.setScaleY(6); Path p = new Path(); p.getElements().add(new MoveTo(200, 200)); p.getElements().add(new LineTo(400, 400)); PathTransition pt = new PathTransition(); pt.setDuration(Duration.millis(10000)); pt.setNode(txt); pt.setPath(p); pt.setAutoReverse(true); pt.play(); root.getChildren().add(txt); //Utils.addBrowser(scene); return scene; } @Override public void start(Stage stage) throws Exception { stage.setTitle(this.getClass().getSimpleName()); scene = getScene(); stage.setScene(scene); stage.show(); } public static void main(String[] args) { //Utils.launch(MultiTouchApp.class, args); Application.launch(MoveTextWithStrokeTest.class, args); } }