Commits

shemnon committed 9043d0b

Fully Expressed demo, where I configure as much as ever should be configured.

  • Participants
  • Parent commits 387e632

Comments (0)

Files changed (10)

File samples/FullyExpressed/build.gradle

+apply from: 'https://repository-javafx-gradle-plugin.forge.cloudbees.com/snapshot/javafx.plugin'
+apply plugin: 'idea'
+
+javafx {
+
+    // you can hand configure these, but I don't
+    //jfxrtJar = file('jfxrt.jar')
+    //antJavaFXJar = file('ant-javafx.jar')
+
+    debugKey {
+        alias = 'buggyKey'
+        keypass = '123456'
+        keystore = file('veryinsecure.jks')
+        storepass = '123456'
+    }
+    releaseKey {
+        alias = 'selfsigned'
+        keypass = 'password'
+        keystore = file('insecure.jks')
+        storepass = 'password'
+    }
+    signingMode = 'release'
+
+    appID = 'FullyExpressed'
+    appName = 'Fully Expressed Build File'
+    mainClass = 'com.bitbucket.shemnon.jfx.sample.fullyexpressed.TheMain'
+
+    packaging = 'image'
+}
+
+generateDebugKey {
+    dname='ou=them'
+    validity=1
+}
+
+jfxDeploy {
+    // applet and webstart stuff
+    width = 800
+    height = 600
+    embedJNLP = false
+
+    // verbose output of the deployment, to the info chanel
+    // it leaves files in the temp dir if set to true
+    verbose = false
+
+
+    // deplpy/info attributes
+    category = 'demo'
+    copyright = 'Copyright (c) 2012 Danno Ferrin'
+    description = '''If it can and ever should be configured, it is configured in this build.
+But really, you should live with the conventions when appropriate.'''
+    license = '3 clause BSD'
+    vendor = 'Me!'
+
+    // deploy/preferences attributes
+    installSystemWide = true
+    menu = true
+    shortcut = true
+}

File samples/FullyExpressed/insecure.jks

Binary file added.

File samples/FullyExpressed/src/main/java/com/bitbucket/shemnon/jfx/sample/fullyexpressed/TheController.java

+package com.bitbucket.shemnon.jfx.sample.fullyexpressed;
+
+import javafx.scene.input.RotateEvent;
+import javafx.scene.input.SwipeEvent;
+import javafx.scene.input.TouchEvent;
+import javafx.scene.input.ZoomEvent;
+import javafx.scene.shape.Arc;
+
+public class TheController {
+    
+    public void onRotate(RotateEvent re) {
+        Arc a = (Arc)re.getSource();
+        double delta = re.getAngle();
+        a.setStartAngle(a.getStartAngle() + delta);
+    }
+    
+    public void onRotateFinished(RotateEvent re) {
+        System.out.println(re);
+    }
+    
+    public void onRotateStarted(RotateEvent re) {
+        System.out.println(re);
+    }
+
+    public void onSwipeDown(SwipeEvent se) {
+        System.out.println(se);
+    }
+
+    public void onSwipeLeft(SwipeEvent se) {
+        System.out.println(se);
+    }
+
+    public void onSwipeRight(SwipeEvent se) {
+        System.out.println(se);
+    }
+
+    public void onSwipeUp(SwipeEvent se) {
+        System.out.println(se);
+    }
+
+    public void onTouchMoved(TouchEvent te) {
+        System.out.println(te);
+    }
+
+    public void onTouchPressed(TouchEvent te) {
+        System.out.println(te);
+    }
+
+    public void onTouchReleased(TouchEvent te) {
+        System.out.println(te);
+    }
+
+    public void onTouchStationary(TouchEvent te) {
+        System.out.println(te);
+    }
+
+    public void onZoom(ZoomEvent ze) {
+        Arc a = (Arc)ze.getSource();
+        double delta = ze.getZoomFactor();
+        double scale = a.getScaleX() * delta;
+        a.setScaleX(scale);
+        a.setScaleY(scale);
+    }
+
+    public void onZoomFinished(ZoomEvent ze) {
+        System.out.println(ze);
+    }
+
+    public void onZoomStarted(ZoomEvent ze) {
+        System.out.println(ze);
+    }
+
+
+}

File samples/FullyExpressed/src/main/java/com/bitbucket/shemnon/jfx/sample/fullyexpressed/TheMain.java

+package com.bitbucket.shemnon.jfx.sample.fullyexpressed;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+import java.util.ResourceBundle;
+
+public class TheMain extends Application {
+
+    @Override
+    public void start(Stage stage) throws Exception {
+        FXMLLoader fxmlLoader = new FXMLLoader();
+        fxmlLoader.setResources(ResourceBundle.getBundle("com.bitbucket.shemnon.jfx.sample.fullyexpressed.TheResources"));
+        StackPane pane = (StackPane) fxmlLoader.load(this.getClass().getResource("theScene.fxml").openStream());
+
+        Scene scene = new Scene(pane);
+        scene.getStylesheets().setAll(
+                getClass().getResource("theStyles.css").toExternalForm());
+        stage.setScene(scene);
+        stage.sizeToScene();
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(TheMain.class, args);
+
+    }
+}

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theResources.properties

+hello=Hello! I'm Dora!

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theResources_de.properties

+hello=Hallo! Ich bin Dora!

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theResources_es.properties

+hello=Hola! Yo soy Dora!

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theResources_pt.properties

+hello=Ol�! Eu sou Dora!

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theScene.fxml

+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import java.lang.*?>
+<?import java.net.*?>
+<?import java.util.*?>
+<?import javafx.scene.layout.*?>
+<?import javafx.scene.paint.*?>
+<?import javafx.scene.shape.*?>
+<?import javafx.scene.text.*?>
+
+<StackPane id="StackPane" prefHeight="400.0" prefWidth="400.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.bitbucket.shemnon.jfx.sample.fullyexpressed.TheController">
+  <children>
+    <VBox id="VBox" alignment="CENTER" spacing="5.0">
+      <children>
+        <Text id="" strokeType="OUTSIDE" strokeWidth="0.0" styleClass="funnytext" text="Gradle" />
+        <Arc fx:id="pie" fill="#fff500" length="270.0" onRotate="#onRotate" onRotationFinished="#onRotateFinished" onRotationStarted="#onRotateStarted" onSwipeDown="#onSwipeDown" onSwipeLeft="#onSwipeLeft" onSwipeRight="#onSwipeRight" onSwipeUp="#onSwipeUp" onTouchMoved="#onTouchMoved" onTouchPressed="#onTouchPressed" onTouchReleased="#onTouchReleased" onTouchStationary="#onTouchStationary" onZoom="#onZoom" onZoomFinished="#onZoomFinished" onZoomStarted="#onZoomStarted" radiusX="100.0" radiusY="100.0" startAngle="45.0" stroke="BLACK" strokeType="INSIDE" type="ROUND" />
+        <Text id="" scaleY="0.9999920270442658" strokeType="OUTSIDE" strokeWidth="0.0" styleClass="funnytext" text="%hello" />
+      </children>
+    </VBox>
+  </children>
+</StackPane>

File samples/FullyExpressed/src/main/resources/com/bitbucket/shemnon/jfx/sample/fullyexpressed/theStyles.css

+.funnytext {
+    -fx-font: 40 cursive, fantasy, monospace;
+    -fx-font-smoothing-type: lcd;
+    -fx-fill: red;
+}