1.1 --- a/chess/pom.xml Thu Mar 27 09:57:14 2014 +0100
1.2 +++ b/chess/pom.xml Thu Mar 27 15:14:48 2014 +0100
1.3 @@ -141,6 +141,11 @@
1.4 <scope>provided</scope>
1.5 <type>jar</type>
1.6 </dependency>
1.7 + <dependency>
1.8 + <groupId>org.netbeans.html</groupId>
1.9 + <artifactId>ko4j</artifactId>
1.10 + <version>${net.java.html.version}</version>
1.11 + </dependency>
1.12 </dependencies>
1.13 <profiles>
1.14 <profile>
1.15 @@ -252,5 +257,78 @@
1.16 </dependency>
1.17 </dependencies>
1.18 </profile>
1.19 + <profile>
1.20 + <id>teabrwsr</id>
1.21 + <build>
1.22 + <plugins>
1.23 + <plugin>
1.24 + <groupId>org.teavm</groupId>
1.25 + <artifactId>teavm-maven-plugin</artifactId>
1.26 + <version>${teavm.version}</version>
1.27 + <dependencies>
1.28 + <dependency>
1.29 + <groupId>org.teavm</groupId>
1.30 + <artifactId>teavm-classlib</artifactId>
1.31 + <version>${teavm.version}</version>
1.32 + </dependency>
1.33 + <!-- This module adds html4j support. It mainly includes JavaScriptBuilder support.
1.34 + Also there are some little patches to JCL emulation, that are required to pass TCK -->
1.35 + <dependency>
1.36 + <groupId>org.teavm</groupId>
1.37 + <artifactId>teavm-html4j</artifactId>
1.38 + <version>${teavm.version}</version>
1.39 + </dependency>
1.40 + </dependencies>
1.41 + <executions>
1.42 + <execution>
1.43 + <id>generate-minesweeper</id>
1.44 + <goals>
1.45 + <goal>build-javascript</goal>
1.46 + </goals>
1.47 + <phase>process-classes</phase>
1.48 + <configuration>
1.49 + <!-- Whether we want TeaVM to minify (obfuscate) the generated JavaScript -->
1.50 + <minifying>false</minifying>
1.51 + <properties>
1.52 + <!-- This classes (separated with , ; space) will be available through vm.loadClass() -->
1.53 + <html4j.entryPoints>org.apidesign.html.demo.chess.LoadMain</html4j.entryPoints>
1.54 + </properties>
1.55 + <!-- Don't include main page - we created it by ourselves -->
1.56 + <mainPageIncluded>false</mainPageIncluded>
1.57 + <!-- Merge runtime.js instead of putting as a separate file -->
1.58 + <runtime>MERGED</runtime>
1.59 + <!-- Name of the generated file -->
1.60 + <targetFileName>bck2brwsr.js</targetFileName>
1.61 + <targetDirectory>${project.build.directory}/teavm</targetDirectory>
1.62 + <!-- This transformer adds null checks before virtual calls. It is not included
1.63 + by default as we don't always need these null checks -->
1.64 + <transformers>
1.65 + <param>org.teavm.javascript.NullPointerExceptionTransformer</param>
1.66 + </transformers>
1.67 + </configuration>
1.68 + </execution>
1.69 + </executions>
1.70 + </plugin>
1.71 + <plugin>
1.72 + <artifactId>maven-assembly-plugin</artifactId>
1.73 + <version>2.4</version>
1.74 + <executions>
1.75 + <execution>
1.76 + <id>distro-assembly</id>
1.77 + <phase>package</phase>
1.78 + <goals>
1.79 + <goal>single</goal>
1.80 + </goals>
1.81 + <configuration>
1.82 + <descriptors>
1.83 + <descriptor>src/main/assembly/teabrwsr.xml</descriptor>
1.84 + </descriptors>
1.85 + </configuration>
1.86 + </execution>
1.87 + </executions>
1.88 + </plugin>
1.89 + </plugins>
1.90 + </build>
1.91 + </profile>
1.92 </profiles>
1.93 </project>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/chess/src/main/assembly/teabrwsr.xml Thu Mar 27 15:14:48 2014 +0100
2.3 @@ -0,0 +1,47 @@
2.4 +<?xml version="1.0"?>
2.5 +<!--
2.6 +
2.7 + The MIT License (MIT)
2.8 +
2.9 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
2.10 +
2.11 + Permission is hereby granted, free of charge, to any person obtaining a copy
2.12 + of this software and associated documentation files (the "Software"), to deal
2.13 + in the Software without restriction, including without limitation the rights
2.14 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2.15 + copies of the Software, and to permit persons to whom the Software is
2.16 + furnished to do so, subject to the following conditions:
2.17 +
2.18 + The above copyright notice and this permission notice shall be included in
2.19 + all copies or substantial portions of the Software.
2.20 +
2.21 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2.22 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2.23 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2.24 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2.25 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2.26 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2.27 + THE SOFTWARE.
2.28 +
2.29 +-->
2.30 +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2.31 + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
2.32 +
2.33 + <id>teabrwsr</id>
2.34 + <formats>
2.35 + <format>zip</format>
2.36 + </formats>
2.37 + <baseDirectory>public_html</baseDirectory>
2.38 + <fileSets>
2.39 + <fileSet>
2.40 + <directory>src/main/webapp/pages</directory>
2.41 + <outputDirectory>/</outputDirectory>
2.42 + <filtered>true</filtered>
2.43 + </fileSet>
2.44 + <fileSet>
2.45 + <directory>${project.build.directory}/teavm/</directory>
2.46 + <outputDirectory>/</outputDirectory>
2.47 + <filtered>false</filtered>
2.48 + </fileSet>
2.49 + </fileSets>
2.50 +</assembly>
3.1 --- a/minesweeper/AndroidManifest.xml Thu Mar 27 09:57:14 2014 +0100
3.2 +++ b/minesweeper/AndroidManifest.xml Thu Mar 27 15:14:48 2014 +0100
3.3 @@ -39,7 +39,7 @@
3.4 android:icon="@drawable/ic_launcher"
3.5 android:label="@string/app_name"
3.6 android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
3.7 - <activity android:name="org.apidesign.html.brwsr.DlvkBrwsr"
3.8 + <activity android:name="org.apidesign.brwsr.DlvkBrwsr"
3.9 android:configChanges="orientation|screenSize">
3.10 <intent-filter>
3.11 <action android:name="android.intent.action.MAIN" />
3.12 @@ -48,8 +48,8 @@
3.13 </intent-filter>
3.14 </activity>
3.15 <meta-data android:name="loadPage" android:value="file:///android_asset/pages/index.html" />
3.16 - <meta-data android:name="loadClass" android:value="org.apidesign.demo.minesweeper.Main" />
3.17 - <meta-data android:name="invoke" android:value="onPageLoad" />
3.18 + <meta-data android:name="loadClass" android:value="org.apidesign.demo.minesweeper.MinesModel" />
3.19 + <meta-data android:name="invoke" android:value="main" />
3.20 </application>
3.21
3.22 </manifest>
3.23 \ No newline at end of file
4.1 --- a/minesweeper/nbactions.xml Thu Mar 27 09:57:14 2014 +0100
4.2 +++ b/minesweeper/nbactions.xml Thu Mar 27 15:14:48 2014 +0100
4.3 @@ -23,29 +23,5 @@
4.4 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
4.5 THE SOFTWARE.
4.6
4.7 ---><actions>
4.8 - <action>
4.9 - <actionName>run</actionName>
4.10 - <goals>
4.11 - <goal>process-classes</goal>
4.12 - <goal>exec:java</goal>
4.13 - </goals>
4.14 - </action>
4.15 - <action>
4.16 - <actionName>debug</actionName>
4.17 - <goals>
4.18 - <goal>process-classes</goal>
4.19 - <goal>exec:java</goal>
4.20 - </goals>
4.21 - <properties>
4.22 - <jpda.listen>maven</jpda.listen>
4.23 - </properties>
4.24 - </action>
4.25 - <action>
4.26 - <actionName>CUSTOM-iPad Sim</actionName>
4.27 - <displayName>iPad Sim</displayName>
4.28 - <goals>
4.29 - <goal>robovm:ipad-sim</goal>
4.30 - </goals>
4.31 - </action>
4.32 +-->
4.33 </actions>
5.1 --- a/minesweeper/pom.xml Thu Mar 27 09:57:14 2014 +0100
5.2 +++ b/minesweeper/pom.xml Thu Mar 27 15:14:48 2014 +0100
5.3 @@ -116,6 +116,11 @@
5.4 </dependency>
5.5 <dependency>
5.6 <groupId>org.netbeans.html</groupId>
5.7 + <artifactId>net.java.html</artifactId>
5.8 + <version>${net.java.html.version}</version>
5.9 + </dependency>
5.10 + <dependency>
5.11 + <groupId>org.netbeans.html</groupId>
5.12 <artifactId>net.java.html.sound</artifactId>
5.13 <version>${net.java.html.version}</version>
5.14 </dependency>
5.15 @@ -125,6 +130,12 @@
5.16 <version>${net.java.html.version}</version>
5.17 </dependency>
5.18 <dependency>
5.19 + <groupId>org.netbeans.html</groupId>
5.20 + <artifactId>nbrwsr</artifactId>
5.21 + <version>${net.java.html.version}</version>
5.22 + <scope>provided</scope>
5.23 + </dependency>
5.24 + <dependency>
5.25 <groupId>org.testng</groupId>
5.26 <artifactId>testng</artifactId>
5.27 <version>6.7</version>
5.28 @@ -253,11 +264,6 @@
5.29 </profile>
5.30 <profile>
5.31 <id>dlvkbrwsr</id>
5.32 - <activation>
5.33 - <property>
5.34 - <name>android.sdk.path</name>
5.35 - </property>
5.36 - </activation>
5.37 <properties>
5.38 <platform.version>4.1.1.4</platform.version>
5.39 <android.plugin.version>3.7.0</android.plugin.version>
5.40 @@ -271,9 +277,9 @@
5.41 <scope>provided</scope>
5.42 </dependency>
5.43 <dependency>
5.44 - <groupId>org.apidesign.html</groupId>
5.45 + <groupId>org.apidesign.brwsr</groupId>
5.46 <artifactId>dlvkbrwsr</artifactId>
5.47 - <version>0.2-SNAPSHOT</version>
5.48 + <version>0.5</version>
5.49 <type>jar</type>
5.50 </dependency>
5.51 <dependency>
5.52 @@ -308,6 +314,7 @@
5.53 <metaInclude>services/org.apidesign.**</metaInclude>
5.54 </metaIncludes>
5.55 </apk>
5.56 + <extractDuplicates>true</extractDuplicates>
5.57 <file>${project.build.directory}/${project.build.finalName}.apk</file>
5.58 </configuration>
5.59 <executions>
5.60 @@ -344,7 +351,165 @@
5.61 </plugin>
5.62 </plugins>
5.63 </build>
5.64 -
5.65 </profile>
5.66 + <profile>
5.67 + <id>teabrwsr</id>
5.68 + <build>
5.69 + <plugins>
5.70 + <plugin>
5.71 + <groupId>org.teavm</groupId>
5.72 + <artifactId>teavm-maven-plugin</artifactId>
5.73 + <version>${teavm.version}</version>
5.74 + <dependencies>
5.75 + <dependency>
5.76 + <groupId>org.teavm</groupId>
5.77 + <artifactId>teavm-classlib</artifactId>
5.78 + <version>${teavm.version}</version>
5.79 + </dependency>
5.80 + <!-- This module adds html4j support. It mainly includes JavaScriptBuilder support.
5.81 + Also there are some little patches to JCL emulation, that are required to pass TCK -->
5.82 + <dependency>
5.83 + <groupId>org.teavm</groupId>
5.84 + <artifactId>teavm-html4j</artifactId>
5.85 + <version>${teavm.version}</version>
5.86 + </dependency>
5.87 + </dependencies>
5.88 + <executions>
5.89 + <execution>
5.90 + <id>generate-minesweeper</id>
5.91 + <goals>
5.92 + <goal>build-javascript</goal>
5.93 + </goals>
5.94 + <phase>process-classes</phase>
5.95 + <configuration>
5.96 + <!-- Whether we want TeaVM to minify (obfuscate) the generated JavaScript -->
5.97 + <minifying>false</minifying>
5.98 + <properties>
5.99 + <!-- This classes (separated with , ; space) will be available through vm.loadClass() -->
5.100 + <html4j.entryPoints>org.apidesign.demo.minesweeper.MainBrwsr</html4j.entryPoints>
5.101 + </properties>
5.102 + <!-- Don't include main page - we created it by ourselves -->
5.103 + <mainPageIncluded>false</mainPageIncluded>
5.104 + <!-- Merge runtime.js instead of putting as a separate file -->
5.105 + <runtime>MERGED</runtime>
5.106 + <!-- Name of the generated file -->
5.107 + <targetFileName>bck2brwsr.js</targetFileName>
5.108 + <targetDirectory>${project.build.directory}/teavm</targetDirectory>
5.109 + <!-- This transformer adds null checks before virtual calls. It is not included
5.110 + by default as we don't always need these null checks -->
5.111 + <transformers>
5.112 + <param>org.teavm.javascript.NullPointerExceptionTransformer</param>
5.113 + </transformers>
5.114 + </configuration>
5.115 + </execution>
5.116 + </executions>
5.117 + </plugin>
5.118 + <plugin>
5.119 + <artifactId>maven-assembly-plugin</artifactId>
5.120 + <version>2.4</version>
5.121 + <executions>
5.122 + <execution>
5.123 + <id>distro-assembly</id>
5.124 + <phase>package</phase>
5.125 + <goals>
5.126 + <goal>single</goal>
5.127 + </goals>
5.128 + <configuration>
5.129 + <descriptors>
5.130 + <descriptor>src/main/assembly/teabrwsr.xml</descriptor>
5.131 + </descriptors>
5.132 + </configuration>
5.133 + </execution>
5.134 + </executions>
5.135 + </plugin>
5.136 + </plugins>
5.137 + </build>
5.138 + </profile>
5.139 + <profile>
5.140 + <id>nbrwsr</id>
5.141 + <dependencies>
5.142 + <dependency>
5.143 + <groupId>org.netbeans.html</groupId>
5.144 + <artifactId>nbrwsr</artifactId>
5.145 + <version>${net.java.html.version}</version>
5.146 + <scope>compile</scope>
5.147 + </dependency>
5.148 + </dependencies>
5.149 + <build>
5.150 + <plugins>
5.151 + <plugin>
5.152 + <groupId>org.apache.maven.plugins</groupId>
5.153 + <artifactId>maven-resources-plugin</artifactId>
5.154 + <version>2.6</version>
5.155 + <executions>
5.156 + <execution>
5.157 + <id>include-webpages</id>
5.158 + <goals>
5.159 + <goal>copy-resources</goal>
5.160 + </goals>
5.161 + <phase>process-resources</phase>
5.162 + <configuration>
5.163 + <outputDirectory>${basedir}/target/classes/org/apidesign/demo/minesweeper</outputDirectory>
5.164 + <overwrite>true</overwrite>
5.165 + <resources>
5.166 + <resource>
5.167 + <directory>src/main/webapp/pages</directory>
5.168 + </resource>
5.169 + </resources>
5.170 + </configuration>
5.171 + </execution>
5.172 + </executions>
5.173 + </plugin>
5.174 + <plugin>
5.175 + <groupId>org.codehaus.mojo</groupId>
5.176 + <artifactId>nbm-maven-plugin</artifactId>
5.177 + <version>3.13</version>
5.178 + <extensions>true</extensions>
5.179 + <executions>
5.180 + <execution>
5.181 + <id>default-manifest</id>
5.182 + <phase>process-classes</phase>
5.183 + <goals>
5.184 + <goal>manifest</goal>
5.185 + </goals>
5.186 + <configuration>
5.187 + <useOSGiDependencies>true</useOSGiDependencies>
5.188 + <brandingToken>html4j4nb</brandingToken>
5.189 + <cluster>html4j4nb</cluster>
5.190 + <verifyIntegrity>false</verifyIntegrity>
5.191 + </configuration>
5.192 + </execution>
5.193 + <execution>
5.194 + <id>default-nbm</id>
5.195 + <phase>package</phase>
5.196 + <goals>
5.197 + <goal>nbm</goal>
5.198 + </goals>
5.199 + <configuration>
5.200 + <useOSGiDependencies>true</useOSGiDependencies>
5.201 + <cluster>html4j4nb</cluster>
5.202 + <verifyIntegrity>false</verifyIntegrity>
5.203 + </configuration>
5.204 + </execution>
5.205 + </executions>
5.206 + <configuration>
5.207 + <useOSGiDependencies>true</useOSGiDependencies>
5.208 + <brandingToken>html4j4nb</brandingToken>
5.209 + <cluster>html4j4nb</cluster>
5.210 + <verifyIntegrity>false</verifyIntegrity>
5.211 + </configuration>
5.212 + </plugin>
5.213 +
5.214 + <plugin>
5.215 + <groupId>org.apache.maven.plugins</groupId>
5.216 + <artifactId>maven-jar-plugin</artifactId>
5.217 + <configuration>
5.218 + <!-- to have the jar plugin pickup the nbm generated manifest -->
5.219 + <useDefaultManifestFile>true</useDefaultManifestFile>
5.220 + </configuration>
5.221 + </plugin>
5.222 + </plugins>
5.223 + </build>
5.224 + </profile>
5.225 </profiles>
5.226 </project>
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/minesweeper/src/main/assembly/teabrwsr.xml Thu Mar 27 15:14:48 2014 +0100
6.3 @@ -0,0 +1,47 @@
6.4 +<?xml version="1.0"?>
6.5 +<!--
6.6 +
6.7 + The MIT License (MIT)
6.8 +
6.9 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
6.10 +
6.11 + Permission is hereby granted, free of charge, to any person obtaining a copy
6.12 + of this software and associated documentation files (the "Software"), to deal
6.13 + in the Software without restriction, including without limitation the rights
6.14 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
6.15 + copies of the Software, and to permit persons to whom the Software is
6.16 + furnished to do so, subject to the following conditions:
6.17 +
6.18 + The above copyright notice and this permission notice shall be included in
6.19 + all copies or substantial portions of the Software.
6.20 +
6.21 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6.22 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6.23 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
6.24 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
6.25 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
6.26 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
6.27 + THE SOFTWARE.
6.28 +
6.29 +-->
6.30 +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6.31 + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
6.32 +
6.33 + <id>teabrwsr</id>
6.34 + <formats>
6.35 + <format>zip</format>
6.36 + </formats>
6.37 + <baseDirectory>public_html</baseDirectory>
6.38 + <fileSets>
6.39 + <fileSet>
6.40 + <directory>src/main/webapp/pages</directory>
6.41 + <outputDirectory>/</outputDirectory>
6.42 + <filtered>true</filtered>
6.43 + </fileSet>
6.44 + <fileSet>
6.45 + <directory>${project.build.directory}/teavm/</directory>
6.46 + <outputDirectory>/</outputDirectory>
6.47 + <filtered>false</filtered>
6.48 + </fileSet>
6.49 + </fileSets>
6.50 +</assembly>
7.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java Thu Mar 27 09:57:14 2014 +0100
7.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java Thu Mar 27 15:14:48 2014 +0100
7.3 @@ -24,7 +24,10 @@
7.4 package org.apidesign.demo.minesweeper;
7.5
7.6 import net.java.html.boot.BrowserBuilder;
7.7 -import org.apidesign.brwsr.IBrwsrPrsntr;
7.8 +import org.netbeans.api.nbrwsr.OpenHTMLRegistration;
7.9 +import org.openide.awt.ActionID;
7.10 +import org.openide.awt.ActionReference;
7.11 +import org.openide.awt.ActionReferences;
7.12
7.13
7.14 /** Bootstrap and initialization. */
7.15 @@ -34,14 +37,36 @@
7.16
7.17 /** Launches the browser */
7.18 public static void main(String... args) throws Exception {
7.19 - BrowserBuilder.newBrowser(new IBrwsrPrsntr()).
7.20 + BrowserBuilder.newBrowser(new org.apidesign.brwsr.IBrwsrPrsntr()).
7.21 loadPage("pages/index.html").
7.22 - loadClass(Main.class).
7.23 - invoke("onPageLoad", args).
7.24 + loadClass(MinesModel.class).
7.25 + invoke("main", args).
7.26 showAndWait();
7.27 System.exit(0);
7.28 }
7.29
7.30 + //
7.31 + // the following annotations generate registration for NetBeans,
7.32 + // they are harmless in other packaging schemes
7.33 + //
7.34 +
7.35 + @ActionID(
7.36 + category = "Games",
7.37 + id = "org.apidesign.demo.minesweeper"
7.38 + )
7.39 + @OpenHTMLRegistration(
7.40 + url="index.html",
7.41 + displayName = "Play Minesweeper!",
7.42 + iconBase = "org/apidesign/demo/minesweeper/ko4j.png"
7.43 + )
7.44 + @ActionReferences({
7.45 + @ActionReference(path = "Menu/Window"),
7.46 + @ActionReference(path = "Toolbars/Games")
7.47 + })
7.48 + //
7.49 + // end of NetBeans actions registration
7.50 + //
7.51 +
7.52 /** Called when page is ready */
7.53 public static void onPageLoad() throws Exception {
7.54 Mines m = new Mines();
8.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MainBrwsr.java Thu Mar 27 09:57:14 2014 +0100
8.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MainBrwsr.java Thu Mar 27 15:14:48 2014 +0100
8.3 @@ -26,7 +26,7 @@
8.4 public class MainBrwsr {
8.5 static {
8.6 try {
8.7 - Main.onPageLoad();
8.8 + MinesModel.main();
8.9 } catch (Exception ex) {
8.10 throw new IllegalStateException(ex);
8.11 }
9.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java Thu Mar 27 09:57:14 2014 +0100
9.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java Thu Mar 27 15:14:48 2014 +0100
9.3 @@ -39,7 +39,7 @@
9.4 @Property(name = "state", type = MinesModel.GameState.class),
9.5 @Property(name = "rows", type = Row.class, array = true),
9.6 })
9.7 -final class MinesModel {
9.8 +public final class MinesModel {
9.9 enum GameState {
9.10 IN_PROGRESS, WON, LOST;
9.11 }
9.12 @@ -231,7 +231,7 @@
9.13 }
9.14 }
9.15
9.16 - private static final AudioClip TOUCH = AudioClip.create("move.mp3");
9.17 + private static AudioClip TOUCH;
9.18 @Function static void click(Mines model, Square data) {
9.19 if (model.getState() != GameState.IN_PROGRESS) {
9.20 return;
9.21 @@ -243,6 +243,9 @@
9.22 showAllBombs(model, SquareType.EXPLOSION);
9.23 model.setState(GameState.LOST);
9.24 } else {
9.25 + if (TOUCH == null) {
9.26 + TOUCH = AudioClip.create("move.mp3");
9.27 + }
9.28 TOUCH.play();
9.29 expandKnown(model, data);
9.30 model.computeMines();
9.31 @@ -308,5 +311,12 @@
9.32 Square sq = columns.get(x);
9.33 return sq.isMine() ? 1 : 0;
9.34 }
9.35 -
9.36 +
9.37 + /**
9.38 + * Called when page is ready
9.39 + */
9.40 + public static void main(String... args) throws Exception {
9.41 + Mines m = new Mines();
9.42 + m.applyBindings();
9.43 + }
9.44 }
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/minesweeper/src/main/resources/org/apidesign/demo/minesweeper/index.html Thu Mar 27 15:14:48 2014 +0100
10.3 @@ -0,0 +1,35 @@
10.4 +<!--
10.5 +
10.6 + The MIT License (MIT)
10.7 +
10.8 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
10.9 +
10.10 + Permission is hereby granted, free of charge, to any person obtaining a copy
10.11 + of this software and associated documentation files (the "Software"), to deal
10.12 + in the Software without restriction, including without limitation the rights
10.13 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10.14 + copies of the Software, and to permit persons to whom the Software is
10.15 + furnished to do so, subject to the following conditions:
10.16 +
10.17 + The above copyright notice and this permission notice shall be included in
10.18 + all copies or substantial portions of the Software.
10.19 +
10.20 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10.21 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10.22 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10.23 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10.24 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
10.25 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
10.26 + THE SOFTWARE.
10.27 +
10.28 +-->
10.29 +<html>
10.30 + <head>
10.31 + <title>Dummy Page</title>
10.32 + <meta charset="UTF-8">
10.33 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
10.34 + </head>
10.35 + <body>
10.36 + <div>Opps, this is not what you wanted to see!</div>
10.37 + </body>
10.38 +</html>
11.1 Binary file minesweeper/src/main/resources/org/apidesign/demo/minesweeper/ko4j.png has changed
12.1 --- a/minesweeper/src/main/webapp/pages/index.html Thu Mar 27 09:57:14 2014 +0100
12.2 +++ b/minesweeper/src/main/webapp/pages/index.html Thu Mar 27 15:14:48 2014 +0100
12.3 @@ -26,7 +26,7 @@
12.4 <!DOCTYPE html>
12.5 <html>
12.6 <head>
12.7 - <title></title>
12.8 + <title>Minesweeper</title>
12.9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12.10 <link href="bootstrap.css" rel="stylesheet">
12.11 <link href="bootstrap-responsive.css" rel="stylesheet">
12.12 @@ -126,7 +126,7 @@
12.13 our documentation.
12.14 </p>
12.15 <p><a class="btn btn-default"
12.16 - target="_blank" href="http://bits.netbeans.org/html4j/0.7.5/"
12.17 + target="_blank" href="http://bits.netbeans.org/html+java/0.7.6/"
12.18 role="button">Read more »</a></p>
12.19 </div>
12.20 <div class="col-md-4">
12.21 @@ -142,8 +142,10 @@
12.22 target="_blank" href="http://bck2brwsr.apidesign.org"
12.23 role="button">Learn more »</a></p>
12.24 </div>
12.25 + </div>
12.26 </div>
12.27 -
12.28 +
12.29 + <!-- boot bck2brwsr -->
12.30 <script type="text/javascript" src="bck2brwsr.js"></script>
12.31 <script>
12.32 var vm = bck2brwsr('${project.build.finalName}.jar');
13.1 --- a/minesweeper/src/main/webapp/pages/mines.css Thu Mar 27 09:57:14 2014 +0100
13.2 +++ b/minesweeper/src/main/webapp/pages/mines.css Thu Mar 27 15:14:48 2014 +0100
13.3 @@ -45,6 +45,12 @@
13.4 font-size:4em;
13.5 }
13.6
13.7 +table.field td div {
13.8 + position: relative;
13.9 + left: 0;
13.10 + top: 0;
13.11 +}
13.12 +
13.13 table.field td.UNKNOWN {
13.14 background-color: #D6E4E1;
13.15 cursor: pointer;
14.1 --- a/pom.xml Thu Mar 27 09:57:14 2014 +0100
14.2 +++ b/pom.xml Thu Mar 27 15:14:48 2014 +0100
14.3 @@ -13,8 +13,9 @@
14.4 </parent>
14.5 <properties>
14.6 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14.7 - <net.java.html.version>0.8</net.java.html.version>
14.8 + <net.java.html.version>0.7.6</net.java.html.version>
14.9 <bck2brwsr.version>0.8.1</bck2brwsr.version>
14.10 + <teavm.version>0.1</teavm.version>
14.11 <license>COPYING</license>
14.12 </properties>
14.13 <modules>