# HG changeset patch # User Jaroslav Tulach # Date 1376399848 -7200 # Node ID 43c71f709cc83c87c64d8c63a09b3766e60f94b4 # Parent c77a456c27ed331cffe3e2693b06a46ff5a8069b Spinning Cube Demo diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/nbactions-iOS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/nbactions-iOS.xml Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,51 @@ + + + + + run + + package + org.netbeans.ios:ios-maven-plugin:0.2:deploy + + + true + + + + debug + + package + org.netbeans.ios:ios-maven-plugin:0.2:deploy + + + true + true + ${jpda.address} + Debug + + + \ No newline at end of file diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/nbactions.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/nbactions.xml Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,45 @@ + + + + + run + + process-classes + exec:java + + + + debug + + process-classes + exec:java + + + maven + + + diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/pom.xml Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,148 @@ + + + 4.0.0 + + demo + org.apidesign.html + 1.0-SNAPSHOT + + + org.apidesign.demo + spinningcube + 1.0-SNAPSHOT + jar + + Spinning_Cube + + + + ios + NetBeans iOS Maven Plugin + http://beetle.cz.oracle.com/~jtulach/maven/ + + + + + + + UTF-8 + 0.4 + org.apidesign.demo.spinningcube.Main + none + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + ${project.mainclass} + true + lib/ + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + + browser.rootdir + ${basedir}/src/main/webapp/ + + + ${project.mainclass} + + + + maven-assembly-plugin + 2.4 + + + distro-assembly + package + + single + + + + src/main/assembly/html.java.net.xml + + + + + + + + + + org.apidesign.html + net.java.html.json + ${net.java.html.version} + + + org.apidesign.html + net.java.html.boot + ${net.java.html.version} + + + org.apidesign.html + ko-fx + ${net.java.html.version} + runtime + + + org.apidesign.html + boot-fx + ${net.java.html.version} + runtime + + + org.testng + testng + 6.7 + test + + + + + iOS + + + mac + Mac OS X + + + + + + org.netbeans.ios + ios-maven-plugin + 0.2 + + ${project.build.directory}/${project.build.finalName}.jar + ${project.name} + ${project.mainclass} + src/main/webapp/ + + + + + + + diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/src/main/assembly/html.java.net.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/src/main/assembly/html.java.net.xml Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,57 @@ + + + + + html.java.net + + zip + + ${project.build.finalName}-app + + + false + runtime + lib + + + + + ${project.build.directory}/${project.build.finalName}.jar + / + + + + + src/main/webapp/ + / + + pages/** + + + + \ No newline at end of file diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/src/main/java/org/apidesign/demo/spinningcube/DataModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/src/main/java/org/apidesign/demo/spinningcube/DataModel.java Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,46 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2013 Jaroslav Tulach + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.apidesign.demo.spinningcube; + +import net.java.html.json.ComputedProperty; +import net.java.html.json.Model; +import net.java.html.json.Property; + +/** Model with one message and cube with six sides. + * + * @author Jaroslav Tulach + */ +@Model(className = "Data", properties = { + @Property(name = "message", type = String.class), +}) +final class DataModel { + @ComputedProperty static String[] sides(String message) { + String[] arr = new String[6]; + String[] words = message == null ? new String[0] : message.split(" ", 6); + for (int i = 0; i < 6; i++) { + arr[i] = words.length > i ? words[i] : "!"; + } + return arr; + } +} diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/src/main/java/org/apidesign/demo/spinningcube/Main.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/src/main/java/org/apidesign/demo/spinningcube/Main.java Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,53 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2013 Jaroslav Tulach + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.apidesign.demo.spinningcube; + +import net.java.html.boot.BrowserBuilder; + + +/** Bootstrap and initialization. + * + * @author Jaroslav Tulach + */ +public final class Main { + private Main() { + } + + /** Launches the browser */ + public static void main(String... args) throws Exception { + BrowserBuilder.newBrowser(). + loadPage("pages/index.html"). + loadClass(Main.class). + invoke("initialize", args). + showAndWait(); + System.exit(0); + } + + /** Called when page is ready */ + public static void initialize(String... args) throws Exception { + Data d = new Data(); + d.setMessage("Java and HTML go well together!"); + d.applyBindings(); + } +} diff -r c77a456c27ed -r 43c71f709cc8 spinningcube/src/main/webapp/pages/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spinningcube/src/main/webapp/pages/index.html Tue Aug 13 15:17:28 2013 +0200 @@ -0,0 +1,92 @@ + + + + + + + + + + + +

Spinning Cube Demo

+ +
+
+
+
+
+
+
+ +