1.1 --- a/.hgignore Thu Mar 20 10:55:11 2014 +0100
1.2 +++ b/.hgignore Fri Oct 31 23:46:16 2014 +0100
1.3 @@ -1,3 +1,8 @@
1.4 .*~
1.5 .*\.orig$
1.6 .*target/.*
1.7 +\.orig\..*$
1.8 +\.orig$
1.9 +\.chg\..*$
1.10 +\.rej$
1.11 +\.conflict\~$
2.1 --- a/chat/client/pom.xml Thu Mar 20 10:55:11 2014 +0100
2.2 +++ b/chat/client/pom.xml Fri Oct 31 23:46:16 2014 +0100
2.3 @@ -105,17 +105,23 @@
2.4 </dependency>
2.5 <dependency>
2.6 <groupId>org.apidesign.bck2brwsr</groupId>
2.7 - <artifactId>vm4brwsr</artifactId>
2.8 - <version>${bck2brwsr.version}</version>
2.9 - <type>zip</type>
2.10 - <classifier>js</classifier>
2.11 - <scope>provided</scope>
2.12 - </dependency>
2.13 - <dependency>
2.14 - <groupId>org.apidesign.bck2brwsr</groupId>
2.15 <artifactId>ko-bck2brwsr</artifactId>
2.16 <version>${bck2brwsr.version}</version>
2.17 <scope>runtime</scope>
2.18 </dependency>
2.19 + <dependency>
2.20 + <artifactId>ko4j</artifactId>
2.21 + <groupId>org.netbeans.html</groupId>
2.22 + <type>jar</type>
2.23 + <version>${net.java.html.version}</version>
2.24 + <scope>runtime</scope>
2.25 + </dependency>
2.26 + <dependency>
2.27 + <artifactId>net.java.html.boot</artifactId>
2.28 + <groupId>org.netbeans.html</groupId>
2.29 + <type>jar</type>
2.30 + <version>${net.java.html.version}</version>
2.31 + <scope>runtime</scope>
2.32 + </dependency>
2.33 </dependencies>
2.34 </project>
3.1 --- a/chat/server/pom.xml Thu Mar 20 10:55:11 2014 +0100
3.2 +++ b/chat/server/pom.xml Fri Oct 31 23:46:16 2014 +0100
3.3 @@ -119,5 +119,12 @@
3.4 <version>2.3.8</version>
3.5 <scope>runtime</scope>
3.6 </dependency>
3.7 + <dependency>
3.8 + <artifactId>ko-ws-tyrus</artifactId>
3.9 + <groupId>org.netbeans.html</groupId>
3.10 + <type>jar</type>
3.11 + <version>${net.java.html.version}</version>
3.12 + <scope>runtime</scope>
3.13 + </dependency>
3.14 </dependencies>
3.15 </project>
4.1 --- a/minesweeper/AndroidManifest.xml Thu Mar 20 10:55:11 2014 +0100
4.2 +++ b/minesweeper/AndroidManifest.xml Fri Oct 31 23:46:16 2014 +0100
4.3 @@ -33,23 +33,31 @@
4.4 android:minSdkVersion="8"
4.5 android:targetSdkVersion="16" />
4.6
4.7 - <uses-permission android:name="android.permission.INTERNET" />
4.8 <application
4.9 android:allowBackup="true"
4.10 android:icon="@drawable/ic_launcher"
4.11 - android:label="@string/app_name"
4.12 + android:label="Minesweeper"
4.13 android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
4.14 - <activity android:name="org.apidesign.html.dlvkbrwsr.DlvkBrwsr"
4.15 + <activity android:name="org.apidesign.brwsr.DlvkBrwsr"
4.16 android:configChanges="orientation|screenSize">
4.17 <intent-filter>
4.18 <action android:name="android.intent.action.MAIN" />
4.19 -
4.20 <category android:name="android.intent.category.LAUNCHER" />
4.21 </intent-filter>
4.22 </activity>
4.23 +
4.24 + <!-- Configuration section. Defines:
4.25 + - the HTML page to load on start
4.26 + - the class that contains the main initialization method
4.27 + - name of the initialization method in the given class
4.28 + -->
4.29 <meta-data android:name="loadPage" android:value="file:///android_asset/pages/index.html" />
4.30 <meta-data android:name="loadClass" android:value="org.apidesign.demo.minesweeper.MinesModel" />
4.31 <meta-data android:name="invoke" android:value="main" />
4.32 </application>
4.33 -
4.34 +
4.35 + <!-- allows use of internet and also 'call-home' feature. See
4.36 + licensing section in Javadoc
4.37 + -->
4.38 + <uses-permission android:name="android.permission.INTERNET" />
4.39 </manifest>
4.40 \ No newline at end of file
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/minesweeper/Info.plist.xml Fri Oct 31 23:46:16 2014 +0100
5.3 @@ -0,0 +1,71 @@
5.4 +<?xml version="1.0" encoding="UTF-8"?>
5.5 +<!--
5.6 +
5.7 + The MIT License (MIT)
5.8 +
5.9 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
5.10 +
5.11 + Permission is hereby granted, free of charge, to any person obtaining a copy
5.12 + of this software and associated documentation files (the "Software"), to deal
5.13 + in the Software without restriction, including without limitation the rights
5.14 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5.15 + copies of the Software, and to permit persons to whom the Software is
5.16 + furnished to do so, subject to the following conditions:
5.17 +
5.18 + The above copyright notice and this permission notice shall be included in
5.19 + all copies or substantial portions of the Software.
5.20 +
5.21 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5.22 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5.23 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5.24 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5.25 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5.26 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5.27 + THE SOFTWARE.
5.28 +
5.29 +-->
5.30 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5.31 +<plist version="1.0">
5.32 + <dict>
5.33 + <key>CFBundleDevelopmentRegion</key>
5.34 + <string>en</string>
5.35 + <key>CFBundleDisplayName</key>
5.36 + <string>Fair Mines</string>
5.37 + <key>CFBundleExecutable</key>
5.38 + <string>MineSweeper</string>
5.39 + <key>CFBundleIdentifier</key>
5.40 + <string>jst</string>
5.41 + <key>CFBundleInfoDictionaryVersion</key>
5.42 + <string>6.0</string>
5.43 + <key>CFBundleName</key>
5.44 + <string>Fair Mines</string>
5.45 + <key>CFBundlePackageType</key>
5.46 + <string>APPL</string>
5.47 + <key>CFBundleShortVersionString</key>
5.48 + <string>2.3</string>
5.49 + <key>CFBundleSignature</key>
5.50 + <string>????</string>
5.51 + <key>CFBundleVersion</key>
5.52 + <string>1</string>
5.53 + <key>NSHumanReadableCopyright</key>
5.54 + <string>Copyright © 2014 Jaroslav Tulach. All rights reserved.</string>
5.55 + <key>LSRequiresIPhoneOS</key>
5.56 + <true/>
5.57 + <key>UIDeviceFamily</key>
5.58 + <array>
5.59 + <integer>1</integer>
5.60 + <integer>2</integer>
5.61 + </array>
5.62 + <key>UIRequiredDeviceCapabilities</key>
5.63 + <array>
5.64 + <string>armv7</string>
5.65 + </array>
5.66 + <key>UISupportedInterfaceOrientations</key>
5.67 + <array>
5.68 + <string>UIInterfaceOrientationPortrait</string>
5.69 + <string>UIInterfaceOrientationLandscapeLeft</string>
5.70 + <string>UIInterfaceOrientationLandscapeRight</string>
5.71 + <string>UIInterfaceOrientationPortraitUpsideDown</string>
5.72 + </array>
5.73 + </dict>
5.74 +</plist>
6.1 --- a/minesweeper/nbactions-bck2brwsr.xml Thu Mar 20 10:55:11 2014 +0100
6.2 +++ b/minesweeper/nbactions-bck2brwsr.xml Fri Oct 31 23:46:16 2014 +0100
6.3 @@ -29,7 +29,7 @@
6.4 <actionName>run</actionName>
6.5 <goals>
6.6 <goal>package</goal>
6.7 - <goal>bck2brwsr:brwsr</goal>
6.8 + <goal>bck2brwsr:show</goal>
6.9 </goals>
6.10 <properties>
6.11 <skipTests>true</skipTests>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/minesweeper/nbactions-ibrwsr.xml Fri Oct 31 23:46:16 2014 +0100
7.3 @@ -0,0 +1,35 @@
7.4 +<?xml version="1.0" encoding="UTF-8"?>
7.5 +<!--
7.6 +
7.7 + The MIT License (MIT)
7.8 +
7.9 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
7.10 +
7.11 + Permission is hereby granted, free of charge, to any person obtaining a copy
7.12 + of this software and associated documentation files (the "Software"), to deal
7.13 + in the Software without restriction, including without limitation the rights
7.14 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7.15 + copies of the Software, and to permit persons to whom the Software is
7.16 + furnished to do so, subject to the following conditions:
7.17 +
7.18 + The above copyright notice and this permission notice shall be included in
7.19 + all copies or substantial portions of the Software.
7.20 +
7.21 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7.22 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7.23 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7.24 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7.25 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7.26 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
7.27 + THE SOFTWARE.
7.28 +
7.29 +-->
7.30 +<actions>
7.31 + <action>
7.32 + <actionName>run</actionName>
7.33 + <goals>
7.34 + <goal>package</goal>
7.35 + <goal>robovm:ipad-sim</goal>
7.36 + </goals>
7.37 + </action>
7.38 +</actions>
8.1 --- a/minesweeper/nbactions.xml Thu Mar 20 10:55:11 2014 +0100
8.2 +++ b/minesweeper/nbactions.xml Fri Oct 31 23:46:16 2014 +0100
8.3 @@ -24,22 +24,4 @@
8.4 THE SOFTWARE.
8.5
8.6 -->
8.7 -<actions>
8.8 - <action>
8.9 - <actionName>run</actionName>
8.10 - <goals>
8.11 - <goal>process-classes</goal>
8.12 - <goal>exec:java</goal>
8.13 - </goals>
8.14 - </action>
8.15 - <action>
8.16 - <actionName>debug</actionName>
8.17 - <goals>
8.18 - <goal>process-classes</goal>
8.19 - <goal>exec:java</goal>
8.20 - </goals>
8.21 - <properties>
8.22 - <jpda.listen>maven</jpda.listen>
8.23 - </properties>
8.24 - </action>
8.25 </actions>
9.1 --- a/minesweeper/pom.xml Thu Mar 20 10:55:11 2014 +0100
9.2 +++ b/minesweeper/pom.xml Fri Oct 31 23:46:16 2014 +0100
9.3 @@ -4,7 +4,7 @@
9.4
9.5 <groupId>org.apidesign.demo</groupId>
9.6 <artifactId>minesweeper</artifactId>
9.7 - <version>1.0-SNAPSHOT</version>
9.8 + <version>2.4-SNAPSHOT</version>
9.9 <packaging>jar</packaging>
9.10 <parent>
9.11 <artifactId>demo</artifactId>
9.12 @@ -13,12 +13,20 @@
9.13 </parent>
9.14
9.15 <name>Mine Sweeper</name>
9.16 -
9.17 + <description>
9.18 + Demonstration of DukeScript rendering technology.
9.19 + Plus old, good, simple and entertaining game.
9.20 + Improve your coding skills by playing a game and
9.21 + meanwhile learn what a rendering technology of the
9.22 + future is going to look like. Learn to use DukeScript:
9.23 + Write once, display (and deploy) anywhere!
9.24 + </description>
9.25 + <url>http://html.java.net/</url>
9.26 <properties>
9.27 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9.28 - <brwsr.startpage>pages/index.html</brwsr.startpage>
9.29 <project.mainclass>org.apidesign.demo.minesweeper.Main</project.mainclass>
9.30 <netbeans.compile.on.save>none</netbeans.compile.on.save>
9.31 + <bck2brwsr.obfuscationlevel>FULL</bck2brwsr.obfuscationlevel>
9.32 </properties>
9.33 <build>
9.34 <plugins>
9.35 @@ -74,6 +82,11 @@
9.36 </dependency>
9.37 <dependency>
9.38 <groupId>org.netbeans.html</groupId>
9.39 + <artifactId>net.java.html</artifactId>
9.40 + <version>${net.java.html.version}</version>
9.41 + </dependency>
9.42 + <dependency>
9.43 + <groupId>org.netbeans.html</groupId>
9.44 <artifactId>net.java.html.sound</artifactId>
9.45 <version>${net.java.html.version}</version>
9.46 </dependency>
9.47 @@ -83,6 +96,12 @@
9.48 <version>${net.java.html.version}</version>
9.49 </dependency>
9.50 <dependency>
9.51 + <groupId>org.netbeans.html</groupId>
9.52 + <artifactId>nbrwsr</artifactId>
9.53 + <version>${nb.html.version}</version>
9.54 + <scope>provided</scope>
9.55 + </dependency>
9.56 + <dependency>
9.57 <groupId>org.testng</groupId>
9.58 <artifactId>testng</artifactId>
9.59 <version>6.7</version>
9.60 @@ -98,6 +117,20 @@
9.61 <build>
9.62 <plugins>
9.63 <plugin>
9.64 + <groupId>org.apache.maven.plugins</groupId>
9.65 + <artifactId>maven-jar-plugin</artifactId>
9.66 + <version>2.4</version>
9.67 + <configuration>
9.68 + <archive>
9.69 + <manifest>
9.70 + <mainClass>${project.mainclass}</mainClass>
9.71 + <addClasspath>true</addClasspath>
9.72 + <classpathPrefix>lib/</classpathPrefix>
9.73 + </manifest>
9.74 + </archive>
9.75 + </configuration>
9.76 + </plugin>
9.77 + <plugin>
9.78 <artifactId>maven-assembly-plugin</artifactId>
9.79 <version>2.4</version>
9.80 <executions>
9.81 @@ -130,13 +163,27 @@
9.82 <id>bck2brwsr</id>
9.83 <activation>
9.84 <property>
9.85 - <name>brwsr</name>
9.86 <value>bck2brwsr</value>
9.87 + <name>show</name>
9.88 </property>
9.89 </activation>
9.90 <build>
9.91 <plugins>
9.92 <plugin>
9.93 + <groupId>org.apache.maven.plugins</groupId>
9.94 + <artifactId>maven-jar-plugin</artifactId>
9.95 + <version>2.4</version>
9.96 + <configuration>
9.97 + <archive>
9.98 + <manifest>
9.99 + <mainClass>${project.mainclass}</mainClass>
9.100 + <addClasspath>true</addClasspath>
9.101 + <classpathPrefix>lib/</classpathPrefix>
9.102 + </manifest>
9.103 + </archive>
9.104 + </configuration>
9.105 + </plugin>
9.106 + <plugin>
9.107 <groupId>org.apidesign.bck2brwsr</groupId>
9.108 <artifactId>bck2brwsr-maven-plugin</artifactId>
9.109 <version>${bck2brwsr.version}</version>
9.110 @@ -144,12 +191,19 @@
9.111 <execution>
9.112 <goals>
9.113 <goal>brwsr</goal>
9.114 + <goal>aot</goal>
9.115 </goals>
9.116 </execution>
9.117 </executions>
9.118 <configuration>
9.119 - <directory>${basedir}/src/main/webapp/</directory>
9.120 - <startpage>${brwsr.startpage}</startpage>
9.121 + <obfuscation>${bck2brwsr.obfuscationlevel}</obfuscation>
9.122 + <directory>${project.build.directory}/${project.build.finalName}-bck2brwsr/public_html/</directory>
9.123 + <startpage>index.html</startpage>
9.124 + <classPathPrefix>lib</classPathPrefix>
9.125 + <mainJavaScript>${project.build.directory}/minesweeper.js</mainJavaScript>
9.126 + <exports>
9.127 + <export>org.apidesign.demo.minesweeper.MinesModel</export>
9.128 + </exports>
9.129 </configuration>
9.130 </plugin>
9.131 <plugin>
9.132 @@ -189,6 +243,17 @@
9.133 <classifier>rt</classifier>
9.134 </dependency>
9.135 <dependency>
9.136 + <groupId>org.netbeans.html</groupId>
9.137 + <artifactId>net.java.html.boot</artifactId>
9.138 + <version>${net.java.html.version}</version>
9.139 + <exclusions>
9.140 + <exclusion>
9.141 + <artifactId>asm</artifactId>
9.142 + <groupId>org.ow2.asm</groupId>
9.143 + </exclusion>
9.144 + </exclusions>
9.145 + </dependency>
9.146 + <dependency>
9.147 <groupId>org.apidesign.bck2brwsr</groupId>
9.148 <artifactId>ko-bck2brwsr</artifactId>
9.149 <version>${bck2brwsr.version}</version>
9.150 @@ -206,11 +271,6 @@
9.151 </profile>
9.152 <profile>
9.153 <id>dlvkbrwsr</id>
9.154 - <activation>
9.155 - <property>
9.156 - <name>android.sdk.path</name>
9.157 - </property>
9.158 - </activation>
9.159 <properties>
9.160 <platform.version>4.1.1.4</platform.version>
9.161 <android.plugin.version>3.7.0</android.plugin.version>
9.162 @@ -224,6 +284,12 @@
9.163 <scope>provided</scope>
9.164 </dependency>
9.165 <dependency>
9.166 + <groupId>org.apidesign.brwsr</groupId>
9.167 + <artifactId>dlvkbrwsr</artifactId>
9.168 + <version>1.0</version>
9.169 + <type>jar</type>
9.170 + </dependency>
9.171 + <dependency>
9.172 <groupId>org.netbeans.html</groupId>
9.173 <artifactId>ko-ws-tyrus</artifactId>
9.174 <version>${net.java.html.version}</version>
9.175 @@ -234,33 +300,66 @@
9.176 </exclusion>
9.177 </exclusions>
9.178 </dependency>
9.179 - <dependency>
9.180 - <groupId>org.apidesign.html</groupId>
9.181 - <artifactId>dlvkbrwsr</artifactId>
9.182 - <version>0.1-SNAPSHOT</version>
9.183 - <type>jar</type>
9.184 - </dependency>
9.185 </dependencies>
9.186 <build>
9.187 <plugins>
9.188 <plugin>
9.189 + <groupId>com.filmon.maven</groupId>
9.190 + <artifactId>image-maven-plugin</artifactId>
9.191 + <version>1.1</version>
9.192 + <executions>
9.193 + <execution>
9.194 + <goals>
9.195 + <goal>scale</goal>
9.196 + </goals>
9.197 + <configuration>
9.198 + <outputDirectory>target/res</outputDirectory>
9.199 + <images>
9.200 + <image>
9.201 + <source>src/main/icons/DukeSweeper.png</source>
9.202 + <destination>drawable-hdpi/ic_launcher.png</destination>
9.203 + <width>72</width>
9.204 + </image>
9.205 + <image>
9.206 + <source>src/main/icons/DukeSweeper.png</source>
9.207 + <destination>drawable-mdpi/ic_launcher.png</destination>
9.208 + <width>48</width>
9.209 + </image>
9.210 + <image>
9.211 + <source>src/main/icons/DukeSweeper.png</source>
9.212 + <destination>drawable-xhdpi/ic_launcher.png</destination>
9.213 + <width>96</width>
9.214 + </image>
9.215 + <image>
9.216 + <source>src/main/icons/DukeSweeper.png</source>
9.217 + <destination>drawable-xxhdpi/ic_launcher.png</destination>
9.218 + <width>144</width>
9.219 + </image>
9.220 + </images>
9.221 + </configuration>
9.222 + </execution>
9.223 + </executions>
9.224 + </plugin>
9.225 + <plugin>
9.226 <groupId>com.jayway.maven.plugins.android.generation2</groupId>
9.227 <artifactId>android-maven-plugin</artifactId>
9.228 <version>${android.plugin.version}</version>
9.229 <extensions>true</extensions>
9.230 <configuration>
9.231 + <resourceDirectory>target/res</resourceDirectory>
9.232 <classifier>apk</classifier>
9.233 <attachJar>false</attachJar>
9.234 <apkDebug>debug</apkDebug>
9.235 <assetsDirectory>src/main/webapp</assetsDirectory>
9.236 <sdk>
9.237 - <platform>16</platform>
9.238 + <platform>19</platform>
9.239 </sdk>
9.240 <apk>
9.241 <metaIncludes>
9.242 - <metaInclude>services/org.apidesign.**</metaInclude>
9.243 + <metaInclude>services/org.netbeans.**</metaInclude>
9.244 </metaIncludes>
9.245 </apk>
9.246 + <extractDuplicates>true</extractDuplicates>
9.247 <file>${project.build.directory}/${project.build.finalName}.apk</file>
9.248 </configuration>
9.249 <executions>
9.250 @@ -332,7 +431,7 @@
9.251 <minifying>false</minifying>
9.252 <properties>
9.253 <!-- This classes (separated with , ; space) will be available through vm.loadClass() -->
9.254 - <html4j.entryPoints>org.apidesign.demo.minesweeper.MainBrwsr</html4j.entryPoints>
9.255 + <html4j.entryPoints>org.apidesign.demo.minesweeper.MinesModel</html4j.entryPoints>
9.256 </properties>
9.257 <!-- Don't include main page - we created it by ourselves -->
9.258 <mainPageIncluded>false</mainPageIncluded>
9.259 @@ -371,5 +470,194 @@
9.260 </plugins>
9.261 </build>
9.262 </profile>
9.263 + <profile>
9.264 + <id>ibrwsr</id>
9.265 + <dependencies>
9.266 + <dependency>
9.267 + <groupId>org.apidesign.brwsr</groupId>
9.268 + <artifactId>ibrwsr</artifactId>
9.269 + <version>1.0</version>
9.270 + <scope>runtime</scope>
9.271 + </dependency>
9.272 + </dependencies>
9.273 + <build>
9.274 + <plugins>
9.275 + <plugin>
9.276 + <groupId>com.filmon.maven</groupId>
9.277 + <artifactId>image-maven-plugin</artifactId>
9.278 + <version>1.1</version>
9.279 + <executions>
9.280 + <execution>
9.281 + <goals>
9.282 + <goal>scale</goal>
9.283 + </goals>
9.284 + <configuration>
9.285 + <outputDirectory>target/images</outputDirectory>
9.286 + <images>
9.287 + <image>
9.288 + <source>src/main/icons/DukeSweeper.png</source>
9.289 + <destination>Icon.png</destination>
9.290 + <width>57</width>
9.291 + </image>
9.292 + <image>
9.293 + <source>src/main/icons/DukeSweeper.png</source>
9.294 + <destination>Icon@2.png</destination>
9.295 + <width>114</width>
9.296 + </image>
9.297 + <image>
9.298 + <source>src/main/icons/DukeSweeper.png</source>
9.299 + <destination>Icon-60.png</destination>
9.300 + <width>60</width>
9.301 + </image>
9.302 + <image>
9.303 + <source>src/main/icons/DukeSweeper.png</source>
9.304 + <destination>Icon-60@2.png</destination>
9.305 + <width>120</width>
9.306 + </image>
9.307 + <image>
9.308 + <source>src/main/icons/DukeSweeper.png</source>
9.309 + <destination>Icon-72.png</destination>
9.310 + <width>72</width>
9.311 + </image>
9.312 + <image>
9.313 + <source>src/main/icons/DukeSweeper.png</source>
9.314 + <destination>Icon-76.png</destination>
9.315 + <width>76</width>
9.316 + </image>
9.317 + </images>
9.318 + </configuration>
9.319 + </execution>
9.320 + </executions>
9.321 + </plugin>
9.322 + <plugin>
9.323 + <groupId>org.robovm</groupId>
9.324 + <artifactId>robovm-maven-plugin</artifactId>
9.325 + <version>0.0.14.1</version>
9.326 + <configuration>
9.327 + <config>
9.328 + <mainClass>org.apidesign.demo.minesweeper.Main</mainClass>
9.329 + <forceLinkClasses>
9.330 + <pattern>java.util.logging.ConsoleHandler</pattern>
9.331 + <pattern>java.util.logging.SimpleFormatter</pattern>
9.332 + <pattern>org.netbeans.html.ko4j.KO4J</pattern>
9.333 + <pattern>org.netbeans.html.sound.impl.BrowserAudioEnv</pattern>
9.334 + <pattern>org.apidesign.brwsr.IBrwsrPrsntr</pattern>
9.335 + </forceLinkClasses>
9.336 + <executableName>MineSweeper</executableName>
9.337 + <resources>
9.338 + <resource>src/main/webapp/pages</resource>
9.339 + <resource>
9.340 + <targetPath>/</targetPath>
9.341 + <directory>src/main/icons/</directory>
9.342 + <includes>
9.343 + <include>Default*.png</include>
9.344 + </includes>
9.345 + </resource>
9.346 + <resource>
9.347 + <targetPath>/</targetPath>
9.348 + <directory>target/images/</directory>
9.349 + <includes>
9.350 + <include>*.png</include>
9.351 + </includes>
9.352 + </resource>
9.353 + </resources>
9.354 + <iosInfoPList>Info.plist.xml</iosInfoPList>
9.355 + </config>
9.356 + <includeJFX>false</includeJFX>
9.357 + <!--
9.358 + <iosSignIdentity>iPhone Distribution</iosSignIdentity>
9.359 + <iosProvisioningProfile>9728E91B-1BB7-40D6-8922-3DD3BA5E6ECD</iosProvisioningProfile>
9.360 + -->
9.361 + </configuration>
9.362 + </plugin>
9.363 + </plugins>
9.364 + </build>
9.365 + </profile>
9.366 + <profile>
9.367 + <id>nbrwsr</id>
9.368 + <dependencies>
9.369 + <dependency>
9.370 + <groupId>org.netbeans.html</groupId>
9.371 + <artifactId>nbrwsr</artifactId>
9.372 + <version>${nb.html.version}</version>
9.373 + <scope>compile</scope>
9.374 + </dependency>
9.375 + </dependencies>
9.376 + <build>
9.377 + <plugins>
9.378 + <plugin>
9.379 + <groupId>org.apache.maven.plugins</groupId>
9.380 + <artifactId>maven-resources-plugin</artifactId>
9.381 + <version>2.6</version>
9.382 + <executions>
9.383 + <execution>
9.384 + <id>include-webpages</id>
9.385 + <goals>
9.386 + <goal>copy-resources</goal>
9.387 + </goals>
9.388 + <phase>process-resources</phase>
9.389 + <configuration>
9.390 + <outputDirectory>${basedir}/target/classes/org/apidesign/demo/minesweeper</outputDirectory>
9.391 + <overwrite>true</overwrite>
9.392 + <resources>
9.393 + <resource>
9.394 + <directory>src/main/webapp/pages</directory>
9.395 + </resource>
9.396 + </resources>
9.397 + </configuration>
9.398 + </execution>
9.399 + </executions>
9.400 + </plugin>
9.401 + <plugin>
9.402 + <groupId>org.codehaus.mojo</groupId>
9.403 + <artifactId>nbm-maven-plugin</artifactId>
9.404 + <version>3.13</version>
9.405 + <extensions>true</extensions>
9.406 + <executions>
9.407 + <execution>
9.408 + <id>default-manifest</id>
9.409 + <phase>process-classes</phase>
9.410 + <goals>
9.411 + <goal>manifest</goal>
9.412 + </goals>
9.413 + <configuration>
9.414 + <useOSGiDependencies>true</useOSGiDependencies>
9.415 + <brandingToken>html4j4nb</brandingToken>
9.416 + <cluster>extra</cluster>
9.417 + <verifyIntegrity>false</verifyIntegrity>
9.418 + </configuration>
9.419 + </execution>
9.420 + <execution>
9.421 + <id>default-nbm</id>
9.422 + <phase>package</phase>
9.423 + <goals>
9.424 + <goal>nbm</goal>
9.425 + </goals>
9.426 + <configuration>
9.427 + <useOSGiDependencies>true</useOSGiDependencies>
9.428 + <cluster>extra</cluster>
9.429 + <verifyIntegrity>false</verifyIntegrity>
9.430 + </configuration>
9.431 + </execution>
9.432 + </executions>
9.433 + <configuration>
9.434 + <useOSGiDependencies>true</useOSGiDependencies>
9.435 + <brandingToken>html4j4nb</brandingToken>
9.436 + <cluster>html4j4nb</cluster>
9.437 + <verifyIntegrity>false</verifyIntegrity>
9.438 + </configuration>
9.439 + </plugin>
9.440 +
9.441 + <plugin>
9.442 + <groupId>org.apache.maven.plugins</groupId>
9.443 + <artifactId>maven-jar-plugin</artifactId>
9.444 + <configuration>
9.445 + <!-- to have the jar plugin pickup the nbm generated manifest -->
9.446 + <useDefaultManifestFile>true</useDefaultManifestFile>
9.447 + </configuration>
9.448 + </plugin>
9.449 + </plugins>
9.450 + </build>
9.451 + </profile>
9.452 </profiles>
9.453 </project>
10.1 Binary file minesweeper/res/drawable-hdpi/ic_launcher.png has changed
11.1 Binary file minesweeper/res/drawable-mdpi/ic_launcher.png has changed
12.1 Binary file minesweeper/res/drawable-xhdpi/ic_launcher.png has changed
13.1 Binary file minesweeper/res/drawable-xxhdpi/ic_launcher.png has changed
14.1 --- a/minesweeper/res/layout/activity_main.xml Thu Mar 20 10:55:11 2014 +0100
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,40 +0,0 @@
14.4 -<!--
14.5 -
14.6 - The MIT License (MIT)
14.7 -
14.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
14.9 -
14.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
14.11 - of this software and associated documentation files (the "Software"), to deal
14.12 - in the Software without restriction, including without limitation the rights
14.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14.14 - copies of the Software, and to permit persons to whom the Software is
14.15 - furnished to do so, subject to the following conditions:
14.16 -
14.17 - The above copyright notice and this permission notice shall be included in
14.18 - all copies or substantial portions of the Software.
14.19 -
14.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
14.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
14.26 - THE SOFTWARE.
14.27 -
14.28 --->
14.29 -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
14.30 - android:layout_width="match_parent"
14.31 - android:layout_height="match_parent"
14.32 - android:paddingBottom="@dimen/activity_vertical_margin"
14.33 - android:paddingLeft="@dimen/activity_horizontal_margin"
14.34 - android:paddingRight="@dimen/activity_horizontal_margin"
14.35 - android:paddingTop="@dimen/activity_vertical_margin" >
14.36 -
14.37 - <Button android:layout_width="wrap_content"
14.38 - android:layout_height="wrap_content"
14.39 - android:text="@string/hello_world"
14.40 - android:onClick="click"
14.41 - />
14.42 -
14.43 -</RelativeLayout>
14.44 \ No newline at end of file
15.1 --- a/minesweeper/res/menu/main.xml Thu Mar 20 10:55:11 2014 +0100
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,34 +0,0 @@
15.4 -<!--
15.5 -
15.6 - The MIT License (MIT)
15.7 -
15.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
15.9 -
15.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
15.11 - of this software and associated documentation files (the "Software"), to deal
15.12 - in the Software without restriction, including without limitation the rights
15.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15.14 - copies of the Software, and to permit persons to whom the Software is
15.15 - furnished to do so, subject to the following conditions:
15.16 -
15.17 - The above copyright notice and this permission notice shall be included in
15.18 - all copies or substantial portions of the Software.
15.19 -
15.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
15.26 - THE SOFTWARE.
15.27 -
15.28 --->
15.29 -<menu xmlns:android="http://schemas.android.com/apk/res/android" >
15.30 -
15.31 - <item
15.32 - android:id="@+id/action_settings"
15.33 - android:orderInCategory="100"
15.34 - android:showAsAction="never"
15.35 - android:title="@string/action_settings"/>
15.36 -
15.37 -</menu>
15.38 \ No newline at end of file
16.1 --- a/minesweeper/res/values-sw600dp/dimens.xml Thu Mar 20 10:55:11 2014 +0100
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,33 +0,0 @@
16.4 -<!--
16.5 -
16.6 - The MIT License (MIT)
16.7 -
16.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
16.9 -
16.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
16.11 - of this software and associated documentation files (the "Software"), to deal
16.12 - in the Software without restriction, including without limitation the rights
16.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16.14 - copies of the Software, and to permit persons to whom the Software is
16.15 - furnished to do so, subject to the following conditions:
16.16 -
16.17 - The above copyright notice and this permission notice shall be included in
16.18 - all copies or substantial portions of the Software.
16.19 -
16.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16.26 - THE SOFTWARE.
16.27 -
16.28 --->
16.29 -<resources>
16.30 -
16.31 - <!--
16.32 - Customize dimensions originally defined in res/values/dimens.xml (such as
16.33 - screen margins) for sw600dp devices (e.g. 7" tablets) here.
16.34 - -->
16.35 -
16.36 -</resources>
16.37 \ No newline at end of file
17.1 --- a/minesweeper/res/values-sw720dp-land/dimens.xml Thu Mar 20 10:55:11 2014 +0100
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,34 +0,0 @@
17.4 -<!--
17.5 -
17.6 - The MIT License (MIT)
17.7 -
17.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
17.9 -
17.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
17.11 - of this software and associated documentation files (the "Software"), to deal
17.12 - in the Software without restriction, including without limitation the rights
17.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17.14 - copies of the Software, and to permit persons to whom the Software is
17.15 - furnished to do so, subject to the following conditions:
17.16 -
17.17 - The above copyright notice and this permission notice shall be included in
17.18 - all copies or substantial portions of the Software.
17.19 -
17.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17.26 - THE SOFTWARE.
17.27 -
17.28 --->
17.29 -<resources>
17.30 -
17.31 - <!--
17.32 - Customize dimensions originally defined in res/values/dimens.xml (such as
17.33 - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
17.34 - -->
17.35 - <dimen name="activity_horizontal_margin">128dp</dimen>
17.36 -
17.37 -</resources>
17.38 \ No newline at end of file
18.1 --- a/minesweeper/res/values-v11/styles.xml Thu Mar 20 10:55:11 2014 +0100
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,36 +0,0 @@
18.4 -<!--
18.5 -
18.6 - The MIT License (MIT)
18.7 -
18.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
18.9 -
18.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
18.11 - of this software and associated documentation files (the "Software"), to deal
18.12 - in the Software without restriction, including without limitation the rights
18.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18.14 - copies of the Software, and to permit persons to whom the Software is
18.15 - furnished to do so, subject to the following conditions:
18.16 -
18.17 - The above copyright notice and this permission notice shall be included in
18.18 - all copies or substantial portions of the Software.
18.19 -
18.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18.26 - THE SOFTWARE.
18.27 -
18.28 --->
18.29 -<resources>
18.30 -
18.31 - <!--
18.32 - Base application theme for API 11+. This theme completely replaces
18.33 - AppBaseTheme from res/values/styles.xml on API 11+ devices.
18.34 - -->
18.35 - <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
18.36 - <!-- API 11 theme customizations can go here. -->
18.37 - </style>
18.38 -
18.39 -</resources>
18.40 \ No newline at end of file
19.1 --- a/minesweeper/res/values-v14/styles.xml Thu Mar 20 10:55:11 2014 +0100
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,37 +0,0 @@
19.4 -<!--
19.5 -
19.6 - The MIT License (MIT)
19.7 -
19.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
19.9 -
19.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
19.11 - of this software and associated documentation files (the "Software"), to deal
19.12 - in the Software without restriction, including without limitation the rights
19.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19.14 - copies of the Software, and to permit persons to whom the Software is
19.15 - furnished to do so, subject to the following conditions:
19.16 -
19.17 - The above copyright notice and this permission notice shall be included in
19.18 - all copies or substantial portions of the Software.
19.19 -
19.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19.26 - THE SOFTWARE.
19.27 -
19.28 --->
19.29 -<resources>
19.30 -
19.31 - <!--
19.32 - Base application theme for API 14+. This theme completely replaces
19.33 - AppBaseTheme from BOTH res/values/styles.xml and
19.34 - res/values-v11/styles.xml on API 14+ devices.
19.35 - -->
19.36 - <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
19.37 - <!-- API 14 theme customizations can go here. -->
19.38 - </style>
19.39 -
19.40 -</resources>
19.41 \ No newline at end of file
20.1 --- a/minesweeper/res/values/dimens.xml Thu Mar 20 10:55:11 2014 +0100
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,32 +0,0 @@
20.4 -<!--
20.5 -
20.6 - The MIT License (MIT)
20.7 -
20.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
20.9 -
20.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
20.11 - of this software and associated documentation files (the "Software"), to deal
20.12 - in the Software without restriction, including without limitation the rights
20.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20.14 - copies of the Software, and to permit persons to whom the Software is
20.15 - furnished to do so, subject to the following conditions:
20.16 -
20.17 - The above copyright notice and this permission notice shall be included in
20.18 - all copies or substantial portions of the Software.
20.19 -
20.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20.26 - THE SOFTWARE.
20.27 -
20.28 --->
20.29 -<resources>
20.30 -
20.31 - <!-- Default screen margins, per the Android Design guidelines. -->
20.32 - <dimen name="activity_horizontal_margin">16dp</dimen>
20.33 - <dimen name="activity_vertical_margin">16dp</dimen>
20.34 -
20.35 -</resources>
20.36 \ No newline at end of file
21.1 --- a/minesweeper/res/values/strings.xml Thu Mar 20 10:55:11 2014 +0100
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,34 +0,0 @@
21.4 -<?xml version="1.0" encoding="utf-8"?>
21.5 -<!--
21.6 -
21.7 - The MIT License (MIT)
21.8 -
21.9 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
21.10 -
21.11 - Permission is hereby granted, free of charge, to any person obtaining a copy
21.12 - of this software and associated documentation files (the "Software"), to deal
21.13 - in the Software without restriction, including without limitation the rights
21.14 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21.15 - copies of the Software, and to permit persons to whom the Software is
21.16 - furnished to do so, subject to the following conditions:
21.17 -
21.18 - The above copyright notice and this permission notice shall be included in
21.19 - all copies or substantial portions of the Software.
21.20 -
21.21 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21.22 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21.23 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21.24 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21.25 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21.26 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21.27 - THE SOFTWARE.
21.28 -
21.29 --->
21.30 -<resources>
21.31 -
21.32 - <string name="app_name">Minesweeper</string>
21.33 - <string name="hello">Hello m4dlvk!</string>
21.34 - <string name="action_settings">Settings</string>
21.35 - <string name="hello_world">Hello world!</string>
21.36 -
21.37 -</resources>
21.38 \ No newline at end of file
22.1 --- a/minesweeper/res/values/styles.xml Thu Mar 20 10:55:11 2014 +0100
22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
22.3 @@ -1,28 +0,0 @@
22.4 -<!--
22.5 -
22.6 - The MIT License (MIT)
22.7 -
22.8 - Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
22.9 -
22.10 - Permission is hereby granted, free of charge, to any person obtaining a copy
22.11 - of this software and associated documentation files (the "Software"), to deal
22.12 - in the Software without restriction, including without limitation the rights
22.13 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22.14 - copies of the Software, and to permit persons to whom the Software is
22.15 - furnished to do so, subject to the following conditions:
22.16 -
22.17 - The above copyright notice and this permission notice shall be included in
22.18 - all copies or substantial portions of the Software.
22.19 -
22.20 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22.21 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22.22 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22.23 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22.24 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22.25 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22.26 - THE SOFTWARE.
22.27 -
22.28 --->
22.29 -<resources>
22.30 -
22.31 -</resources>
22.32 \ No newline at end of file
23.1 --- a/minesweeper/src/main/assembly/bck2brwsr.xml Thu Mar 20 10:55:11 2014 +0100
23.2 +++ b/minesweeper/src/main/assembly/bck2brwsr.xml Fri Oct 31 23:46:16 2014 +0100
23.3 @@ -30,39 +30,36 @@
23.4 <id>bck2brwsr</id>
23.5 <formats>
23.6 <format>zip</format>
23.7 + <format>dir</format>
23.8 </formats>
23.9 <baseDirectory>public_html</baseDirectory>
23.10 - <dependencySets>
23.11 - <dependencySet>
23.12 - <useProjectArtifact>false</useProjectArtifact>
23.13 - <scope>runtime</scope>
23.14 - <outputDirectory>lib</outputDirectory>
23.15 - <includes>
23.16 - <include>*:jar</include>
23.17 - <include>*:rt</include>
23.18 - </includes>
23.19 - </dependencySet>
23.20 - <dependencySet>
23.21 - <useProjectArtifact>false</useProjectArtifact>
23.22 - <scope>provided</scope>
23.23 - <includes>
23.24 - <include>*:js</include>
23.25 - </includes>
23.26 - <unpack>true</unpack>
23.27 - <outputDirectory>/</outputDirectory>
23.28 - </dependencySet>
23.29 - </dependencySets>
23.30 <fileSets>
23.31 <fileSet>
23.32 <directory>src/main/webapp/pages</directory>
23.33 <outputDirectory>/</outputDirectory>
23.34 <filtered>true</filtered>
23.35 + <includes>
23.36 + <include>*.html</include>
23.37 + <include>*.css</include>
23.38 + </includes>
23.39 </fileSet>
23.40 + <fileSet>
23.41 + <directory>src/main/webapp/pages</directory>
23.42 + <outputDirectory>/</outputDirectory>
23.43 + <filtered>false</filtered>
23.44 + <excludes>
23.45 + <exclude>*.html</exclude>
23.46 + <exclude>*.css</exclude>
23.47 + </excludes>
23.48 + </fileSet>
23.49 + <fileSet>
23.50 + <directory>${project.build.directory}</directory>
23.51 + <outputDirectory>/</outputDirectory>
23.52 + <includes>
23.53 + <include>bck2brwsr.js</include>
23.54 + <include>minesweeper.js</include>
23.55 + <include>lib/*.js</include>
23.56 + </includes>
23.57 + </fileSet>
23.58 </fileSets>
23.59 - <files>
23.60 - <file>
23.61 - <source>${project.build.directory}/${project.build.finalName}.jar</source>
23.62 - <outputDirectory>/</outputDirectory>
23.63 - </file>
23.64 - </files>
23.65 </assembly>
24.1 Binary file minesweeper/src/main/icons/Default-568h@2x.png has changed
25.1 Binary file minesweeper/src/main/icons/Default.png has changed
26.1 Binary file minesweeper/src/main/icons/Default@2x.png has changed
27.1 Binary file minesweeper/src/main/icons/DukeSweeper.png has changed
28.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java Thu Mar 20 10:55:11 2014 +0100
28.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java Fri Oct 31 23:46:16 2014 +0100
28.3 @@ -23,7 +23,12 @@
28.4 */
28.5 package org.apidesign.demo.minesweeper;
28.6
28.7 +import java.util.Locale;
28.8 import net.java.html.boot.BrowserBuilder;
28.9 +import org.netbeans.api.nbrwsr.OpenHTMLRegistration;
28.10 +import org.openide.awt.ActionID;
28.11 +import org.openide.awt.ActionReference;
28.12 +import org.openide.awt.ActionReferences;
28.13
28.14
28.15 /** Bootstrap and initialization. */
28.16 @@ -32,12 +37,41 @@
28.17 }
28.18
28.19 /** Launches the browser */
28.20 - public static void main(String... args) throws Exception {
28.21 + public static void main(String... args) throws Exception {
28.22 BrowserBuilder.newBrowser().
28.23 loadPage("pages/index.html").
28.24 + locale(Locale.getDefault()).
28.25 loadClass(MinesModel.class).
28.26 invoke("main", args).
28.27 showAndWait();
28.28 System.exit(0);
28.29 }
28.30 +
28.31 + //
28.32 + // the following annotations generate registration for NetBeans,
28.33 + // they are harmless in other packaging schemes
28.34 + //
28.35 +
28.36 + @ActionID(
28.37 + category = "Games",
28.38 + id = "org.apidesign.demo.minesweeper"
28.39 + )
28.40 + @OpenHTMLRegistration(
28.41 + url="index.html",
28.42 + displayName = "Play Minesweeper!",
28.43 + iconBase = "org/apidesign/demo/minesweeper/ko4j.png"
28.44 + )
28.45 + @ActionReferences({
28.46 + @ActionReference(path = "Menu/Window"),
28.47 + @ActionReference(path = "Toolbars/Games")
28.48 + })
28.49 + //
28.50 + // end of NetBeans actions registration
28.51 + //
28.52 +
28.53 + /** Called when page is ready */
28.54 + public static void onPageLoad() throws Exception {
28.55 + Mines m = new Mines();
28.56 + m.applyBindings();
28.57 + }
28.58 }
29.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java Thu Mar 20 10:55:11 2014 +0100
29.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java Fri Oct 31 23:46:16 2014 +0100
29.3 @@ -41,7 +41,11 @@
29.4 })
29.5 public final class MinesModel {
29.6 enum GameState {
29.7 - IN_PROGRESS, WON, LOST;
29.8 + IN_PROGRESS, MARKING_MINE, WON, LOST;
29.9 + }
29.10 +
29.11 + @ComputedProperty static String gameStyle(GameState state) {
29.12 + return state == GameState.MARKING_MINE ? "MARKING" : "PLAYING";
29.13 }
29.14
29.15 @Model(className = "Row", properties = {
29.16 @@ -55,17 +59,6 @@
29.17 @Property(name = "mine", type = boolean.class)
29.18 })
29.19 static class SquareModel {
29.20 - @ComputedProperty static String html(SquareType state) {
29.21 - if (state == null) return " ";
29.22 - switch (state) {
29.23 - case EXPLOSION: return "✗";
29.24 - case UNKNOWN: return " ";
29.25 - case DISCOVERED: return "✔";
29.26 - case N_0: return " ";
29.27 - }
29.28 - return "ɸ" + (state.ordinal() - 1);
29.29 - }
29.30 -
29.31 @ComputedProperty static String style(SquareType state) {
29.32 return state == null ? null : state.toString();
29.33 }
29.34 @@ -73,7 +66,7 @@
29.35
29.36 enum SquareType {
29.37 N_0, N_1, N_2, N_3, N_4, N_5, N_6, N_7, N_8,
29.38 - UNKNOWN, EXPLOSION, DISCOVERED;
29.39 + UNKNOWN, EXPLOSION, DISCOVERED, MARKED;
29.40
29.41 final boolean isVisible() {
29.42 return name().startsWith("N_");
29.43 @@ -95,6 +88,10 @@
29.44 return state != null;
29.45 }
29.46
29.47 + @ComputedProperty static boolean gameInProgress(GameState state) {
29.48 + return state == GameState.IN_PROGRESS;
29.49 + }
29.50 +
29.51 @Function static void showHelp(Mines model) {
29.52 model.setState(null);
29.53 }
29.54 @@ -108,16 +105,33 @@
29.55
29.56 @Function static void giveUp(Mines model) {
29.57 showAllBombs(model, SquareType.EXPLOSION);
29.58 + model.setState(GameState.LOST);
29.59 + }
29.60 +
29.61 + @Function static void markMine(Mines model) {
29.62 + if (model.getState() == GameState.IN_PROGRESS) {
29.63 + model.setState(GameState.MARKING_MINE);
29.64 + }
29.65 }
29.66
29.67 @ModelOperation static void init(Mines model, int width, int height, int mines) {
29.68 - List<Row> rows = new ArrayList<Row>(height);
29.69 - for (int y = 0; y < height; y++) {
29.70 - Square[] columns = new Square[width];
29.71 - for (int x = 0; x < width; x++) {
29.72 - columns[x] = new Square(SquareType.UNKNOWN, false);
29.73 + List<Row> rows = model.getRows();
29.74 + if (rows.size() != height || rows.get(0).getColumns().size() != width) {
29.75 + rows = new ArrayList<Row>(height);
29.76 + for (int y = 0; y < height; y++) {
29.77 + Square[] columns = new Square[width];
29.78 + for (int x = 0; x < width; x++) {
29.79 + columns[x] = new Square(SquareType.UNKNOWN, false);
29.80 + }
29.81 + rows.add(new Row(columns));
29.82 }
29.83 - rows.add(new Row(columns));
29.84 + } else {
29.85 + for (Row row : rows) {
29.86 + for (Square sq : row.getColumns()) {
29.87 + sq.setState(SquareType.UNKNOWN);
29.88 + sq.setMine(false);
29.89 + }
29.90 + }
29.91 }
29.92
29.93 Random r = new Random();
29.94 @@ -133,8 +147,10 @@
29.95 }
29.96
29.97 model.setState(GameState.IN_PROGRESS);
29.98 - model.getRows().clear();
29.99 - model.getRows().addAll(rows);
29.100 + if (rows != model.getRows()) {
29.101 + model.getRows().clear();
29.102 + model.getRows().addAll(rows);
29.103 + }
29.104 }
29.105
29.106 @ModelOperation static void computeMines(Mines model) {
29.107 @@ -181,6 +197,8 @@
29.108 if (!emptyHidden) {
29.109 model.setState(GameState.WON);
29.110 showAllBombs(model, SquareType.DISCOVERED);
29.111 + AudioClip applause = AudioClip.create("applause.mp3");
29.112 + applause.play();
29.113 }
29.114 }
29.115
29.116 @@ -219,24 +237,149 @@
29.117 }
29.118 }
29.119
29.120 - private static final AudioClip TOUCH = AudioClip.create("move.mp3");
29.121 @Function static void click(Mines model, Square data) {
29.122 + if (model.getState() == GameState.MARKING_MINE) {
29.123 + if (data.getState() == SquareType.UNKNOWN) {
29.124 + data.setState(SquareType.MARKED);
29.125 + if (allMarked(model)) {
29.126 + model.setState(GameState.WON);
29.127 + return;
29.128 + }
29.129 + }
29.130 + model.setState(GameState.IN_PROGRESS);
29.131 + return;
29.132 + }
29.133 if (model.getState() != GameState.IN_PROGRESS) {
29.134 return;
29.135 }
29.136 -
29.137 - switch (data.getState()) {
29.138 - case UNKNOWN:
29.139 - if (data.isMine()) {
29.140 - showAllBombs(model, SquareType.EXPLOSION);
29.141 - model.setState(GameState.LOST);
29.142 - } else {
29.143 - TOUCH.play();
29.144 - expandKnown(model, data);
29.145 + if (data.getState() == SquareType.MARKED) {
29.146 + data.setState(SquareType.UNKNOWN);
29.147 + if (allMarked(model)) {
29.148 + model.setState(GameState.WON);
29.149 + }
29.150 + return;
29.151 + }
29.152 + if (data.getState() != SquareType.UNKNOWN) {
29.153 + return;
29.154 + }
29.155 + if (data.isMine()) {
29.156 + Square fair = atLeastOnePlaceWhereBombCantBe(model);
29.157 + if (fair == null) {
29.158 + if (placeBombElseWhere(model, data)) {
29.159 + cleanedUp(model, data);
29.160 + return;
29.161 }
29.162 - break;
29.163 + }
29.164 + explosion(model);
29.165 + } else {
29.166 + Square takeFrom = tryStealBomb(model, data);
29.167 + if (takeFrom != null) {
29.168 + final Square fair = atLeastOnePlaceWhereBombCantBe(model);
29.169 + if (fair != null) {
29.170 + takeFrom.setMine(false);
29.171 + data.setMine(true);
29.172 + explosion(model);
29.173 + return;
29.174 + }
29.175 + }
29.176 + cleanedUp(model, data);
29.177 }
29.178 }
29.179 +
29.180 + private static void cleanedUp(Mines model, Square data) {
29.181 + AudioClip touch = AudioClip.create("move.mp3");
29.182 + touch.play();
29.183 + expandKnown(model, data);
29.184 + model.computeMines();
29.185 + }
29.186 +
29.187 + private static void explosion(Mines model) {
29.188 + showAllBombs(model, SquareType.EXPLOSION);
29.189 + model.setState(GameState.LOST);
29.190 + AudioClip oops = AudioClip.create("oops.mp3");
29.191 + oops.play();
29.192 + }
29.193 +
29.194 + private static Square tryStealBomb(Mines model, Square data) {
29.195 + data.setMine(true);
29.196 + final List<Row> rows = model.getRows();
29.197 + for (int y = 0; y < rows.size(); y++) {
29.198 + final List<Square> columns = rows.get(y).getColumns();
29.199 + for (int x = 0; x < columns.size(); x++) {
29.200 + Square sq = columns.get(x);
29.201 + if (sq == data) {
29.202 + continue;
29.203 + }
29.204 + if (sq.isMine()) {
29.205 + sq.setMine(false);
29.206 + final boolean ok = isConsistent(model);
29.207 + sq.setMine(true);
29.208 + if (ok) {
29.209 + data.setMine(false);
29.210 + return sq;
29.211 + }
29.212 + }
29.213 + }
29.214 + }
29.215 + data.setMine(false);
29.216 + return null;
29.217 + }
29.218 +
29.219 + private static Square atLeastOnePlaceWhereBombCantBe(Mines model) {
29.220 + final List<Row> rows = model.getRows();
29.221 + Square cantBe = null;
29.222 + int discovered = 0;
29.223 + for (int y = 0; y < rows.size(); y++) {
29.224 + final List<Square> columns = rows.get(y).getColumns();
29.225 + for (int x = 0; x < columns.size(); x++) {
29.226 + Square sq = columns.get(x);
29.227 + if (sq.getState() == SquareType.UNKNOWN) {
29.228 + if (!sq.isMine()) {
29.229 + if (tryStealBomb(model, sq) == null) {
29.230 + cantBe = sq;
29.231 + }
29.232 + }
29.233 + } else {
29.234 + discovered++;
29.235 + }
29.236 + }
29.237 + }
29.238 +
29.239 + if (discovered > 5) {
29.240 + return cantBe;
29.241 + }
29.242 +
29.243 + return null;
29.244 + }
29.245 +
29.246 + private static boolean placeBombElseWhere(Mines model, Square moveBomb) {
29.247 + List<Square> ok = new ArrayList<Square>();
29.248 + moveBomb.setMine(false);
29.249 + final List<Row> rows = model.getRows();
29.250 + for (int y = 0; y < rows.size(); y++) {
29.251 + final List<Square> columns = rows.get(y).getColumns();
29.252 + for (int x = 0; x < columns.size(); x++) {
29.253 + Square sq = columns.get(x);
29.254 + if (sq == moveBomb || sq.isMine() || sq.getState().isVisible()) {
29.255 + continue;
29.256 + }
29.257 + sq.setMine(true);
29.258 + if (isConsistent(model)) {
29.259 + ok.add(sq);
29.260 + }
29.261 + sq.setMine(false);
29.262 + }
29.263 + }
29.264 + if (ok.isEmpty()) {
29.265 + moveBomb.setMine(true);
29.266 + return false;
29.267 + } else {
29.268 + int r = new Random().nextInt(ok.size());
29.269 + ok.get(r).setMine(true);
29.270 + return true;
29.271 + }
29.272 + }
29.273 +
29.274 private static void expandKnown(Mines model, Square data) {
29.275 final List<Row> rows = model.getRows();
29.276 for (int y = 0; y < rows.size(); y++) {
29.277 @@ -260,9 +403,10 @@
29.278 }
29.279 final Square sq = columns.get(x);
29.280 if (sq.getState() == SquareType.UNKNOWN) {
29.281 - sq.setState(SquareType.N_0);
29.282 - model.computeMines();
29.283 - if (sq.getState() == SquareType.N_0) {
29.284 + int around = around(model, x, y);
29.285 + final SquareType t = SquareType.valueOf("N_" + around);
29.286 + sq.setState(t);
29.287 + if (t == SquareType.N_0) {
29.288 expandKnown(model, x - 1, y - 1);
29.289 expandKnown(model, x - 1, y);
29.290 expandKnown(model, x - 1, y + 1);
29.291 @@ -274,7 +418,68 @@
29.292 }
29.293 }
29.294 }
29.295 +
29.296 + private static int around(Mines model, int x, int y) {
29.297 + return
29.298 + minesAt(model, x - 1, y - 1) +
29.299 + minesAt(model, x - 1, y) +
29.300 + minesAt(model, x - 1, y + 1) +
29.301 + minesAt(model, x , y - 1) +
29.302 + minesAt(model, x, y + 1) +
29.303 + minesAt(model, x + 1, y - 1) +
29.304 + minesAt(model, x + 1, y) +
29.305 + minesAt(model, x + 1, y + 1);
29.306 + }
29.307
29.308 + private static int minesAt(Mines model, int x, int y) {
29.309 + if (y < 0 || y >= model.getRows().size()) {
29.310 + return 0;
29.311 + }
29.312 + final List<Square> columns = model.getRows().get(y).getColumns();
29.313 + if (x < 0 || x >= columns.size()) {
29.314 + return 0;
29.315 + }
29.316 + Square sq = columns.get(x);
29.317 + return sq.isMine() ? 1 : 0;
29.318 + }
29.319 +
29.320 + private static boolean isConsistent(Mines m) {
29.321 + for (int row = 0; row < m.getRows().size(); row++) {
29.322 + Row r = m.getRows().get(row);
29.323 + for (int col = 0; col < r.getColumns().size(); col++) {
29.324 + Square sq = r.getColumns().get(col);
29.325 + if (sq.getState().isVisible()) {
29.326 + int around = around(m, col, row);
29.327 + if (around != sq.getState().ordinal()) {
29.328 + return false;
29.329 + }
29.330 + }
29.331 + }
29.332 + }
29.333 + return true;
29.334 + }
29.335 +
29.336 + private static boolean allMarked(Mines m) {
29.337 + for (Row r : m.getRows()) {
29.338 + for (Square sq : r.getColumns()) {
29.339 + if (sq.isMine() == (sq.getState() != SquareType.MARKED)) {
29.340 + return false;
29.341 + }
29.342 + }
29.343 + }
29.344 + for (Row r : m.getRows()) {
29.345 + for (Square sq : r.getColumns()) {
29.346 + if (sq.isMine()) {
29.347 + sq.setState(SquareType.DISCOVERED);
29.348 + } else {
29.349 + sq.setState(SquareType.N_0);
29.350 + }
29.351 + }
29.352 + }
29.353 + computeMines(m);
29.354 + return true;
29.355 + }
29.356 +
29.357 /**
29.358 * Called when page is ready
29.359 */
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/minesweeper/src/main/resources/org/apidesign/demo/minesweeper/index.html Fri Oct 31 23:46:16 2014 +0100
30.3 @@ -0,0 +1,35 @@
30.4 +<!--
30.5 +
30.6 + The MIT License (MIT)
30.7 +
30.8 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
30.9 +
30.10 + Permission is hereby granted, free of charge, to any person obtaining a copy
30.11 + of this software and associated documentation files (the "Software"), to deal
30.12 + in the Software without restriction, including without limitation the rights
30.13 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30.14 + copies of the Software, and to permit persons to whom the Software is
30.15 + furnished to do so, subject to the following conditions:
30.16 +
30.17 + The above copyright notice and this permission notice shall be included in
30.18 + all copies or substantial portions of the Software.
30.19 +
30.20 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30.21 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30.22 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30.23 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30.24 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30.25 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30.26 + THE SOFTWARE.
30.27 +
30.28 +-->
30.29 +<html>
30.30 + <head>
30.31 + <title>Dummy Page</title>
30.32 + <meta charset="UTF-8">
30.33 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
30.34 + </head>
30.35 + <body>
30.36 + <div>Opps, this is not what you wanted to see!</div>
30.37 + </body>
30.38 +</html>
31.1 Binary file minesweeper/src/main/resources/org/apidesign/demo/minesweeper/ko4j.png has changed
32.1 Binary file minesweeper/src/main/webapp/pages/DukeSweeper.png has changed
33.1 Binary file minesweeper/src/main/webapp/pages/android_logo.jpg has changed
34.1 Binary file minesweeper/src/main/webapp/pages/applause.mp3 has changed
35.1 --- a/minesweeper/src/main/webapp/pages/index.html Thu Mar 20 10:55:11 2014 +0100
35.2 +++ b/minesweeper/src/main/webapp/pages/index.html Fri Oct 31 23:46:16 2014 +0100
35.3 @@ -26,14 +26,14 @@
35.4 <!DOCTYPE html>
35.5 <html>
35.6 <head>
35.7 - <title></title>
35.8 + <title>Fair Minesweeper</title>
35.9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
35.10 <link href="bootstrap.css" rel="stylesheet">
35.11 <link href="bootstrap-responsive.css" rel="stylesheet">
35.12 <link href="mines.css" rel="stylesheet">
35.13 <!-- Target tablets -->
35.14 <link href="mines-tablet-large.css"
35.15 - media="(min-width:640px) and (max-width:780px), (min-height:660px) and (max-height:830px)"
35.16 + media="(min-width:640px), (min-height:660px)"
35.17 rel="stylesheet" />
35.18 <link href="mines-tablet-small.css"
35.19 media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)"
35.20 @@ -43,42 +43,51 @@
35.21 media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)"
35.22 rel="stylesheet" />
35.23 <link href="mines-phone-small.css"
35.24 - media="(min-width:250px) and (max-width:410px), (min-height:250px) and (max-height:400px)"
35.25 + media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)"
35.26 rel="stylesheet" />
35.27 <link href="mines-phone-smaller.css"
35.28 - media="(max-width:250px), (max-height:250px)"
35.29 + media="(max-width:300px), (max-height:300px)"
35.30 rel="stylesheet" />
35.31 </head>
35.32 <body>
35.33 <div class="navbar">
35.34 <div class="navbar-inner">
35.35 - <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">Minesweeper</a>
35.36 + <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
35.37 + <img height="20" width="20" src="DukeSweeper.png">
35.38 + <span class="hidden-phone">Minesweeper</span>
35.39 + </a>
35.40 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
35.41 <span>↻</span>
35.42 - <span class="hidden-phone">New Game!</span>
35.43 + <span class="info-text">New!</span>
35.44 </button>
35.45 - <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !fieldShowing(), click: giveUp ">
35.46 + <button class="hidden-phone btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
35.47 <span>✗</span>
35.48 - <span class="hidden-phone">Show Mines!</span>
35.49 + <span>Show Mines!</span>
35.50 + </button>
35.51 + <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
35.52 + <span>⚠</span>
35.53 + <span class="info-text">Mark Mine!</span>
35.54 </button>
35.55 </div>
35.56 </div>
35.57 -
35.58 +
35.59
35.60 <script type="text/html" id="field">
35.61 - <table class="field">
35.62 + <center>
35.63 + <table class="field" data-bind="css: gameStyle">
35.64 <tbody>
35.65 <!-- ko foreach: rows -->
35.66 <tr>
35.67 <!-- ko foreach: columns -->
35.68 <td data-bind="css: style, click: $parents[1].click" >
35.69 - <div data-bind='html: html'></div>
35.70 + <div></div>
35.71 </td>
35.72 <!-- /ko -->
35.73 </tr>
35.74 <!-- /ko -->
35.75 </tbody>
35.76 </table>
35.77 + </center>
35.78 </script>
35.79
35.80 <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
35.81 @@ -102,17 +111,18 @@
35.82 </div>
35.83
35.84 <div class="container" data-bind="visible: !fieldShowing()">
35.85 - <div class="row">
35.86 + <div>
35.87 <div class="col-md-4">
35.88 <h2>Minesweeper</h2>
35.89 <p>
35.90 - At the end this is a <em>minesweeper</em>
35.91 - game and you can of course play it. Discover
35.92 - all fields that don't contain a mine.
35.93 - Touch a field to find out if there is
35.94 - a mine or not. A number on a field indicates
35.95 - how many mines is in the eight surrounding
35.96 - fields.
35.97 + Discover ten square fields that contain a mine and
35.98 + mark them with a ⚠ sign.
35.99 + Touch a square to find out if there is
35.100 + a mine or not and
35.101 + how many mines are in the eight surrounding
35.102 + ones. Avoid random play, the game
35.103 + recognizes guessing and can re-arrange
35.104 + the mines. This game is <b>fair</b>!
35.105 </p>
35.106 <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play »</a></p>
35.107 </div>
35.108 @@ -126,7 +136,7 @@
35.109 our documentation.
35.110 </p>
35.111 <p><a class="btn btn-default"
35.112 - target="_blank" href="http://bits.netbeans.org/html4j/0.7.5/"
35.113 + target="_blank" href="http://bits.netbeans.org/html+java/"
35.114 role="button">Read more »</a></p>
35.115 </div>
35.116 <div class="col-md-4">
35.117 @@ -135,21 +145,100 @@
35.118 While primarily this technology runs on a desktop
35.119 or as a table or phone application, it is possible
35.120 to execute the same unchanged code in a browser
35.121 - as well. To do so, one needs a <strong>bck2brwsr</strong>
35.122 + as well. To do so, one needs a
35.123 + <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>
35.124 virtual machine.
35.125 </p>
35.126 <p><a class="btn btn-default"
35.127 - target="_blank" href="http://bck2brwsr.apidesign.org"
35.128 - role="button">Learn more »</a></p>
35.129 + target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
35.130 + role="button">Try it »</a></p>
35.131 </div>
35.132 </div>
35.133 </div>
35.134 -
35.135 +<div class="container" data-bind="visible: !fieldShowing()">
35.136 + <div class="col-sm-6 col-md-4">
35.137 + <div class="thumbnail">
35.138 + <img src="android_logo.jpg" width="120" height="120" alt="Android">
35.139 + <div class="caption">
35.140 + <h3>DlvkBrwsr</h3>
35.141 + <p>
35.142 + This application has been packaged to run on your Android phone
35.143 + and is available on Google Play! In this mode it
35.144 + uses Dalvik virtual machine to execute Java code natively.
35.145 + It uses Android's WebView to display the UI and execute
35.146 + generated JavaScript. Both these components are
35.147 + bound together via <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
35.148 + DlvkBrwsr</a>.
35.149 + </p>
35.150 + <p>
35.151 + <a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
35.152 + target="_blank"
35.153 + class="btn btn-primary" role="button"
35.154 + >Install »</a>
35.155 + </p>
35.156 + </div>
35.157 + </div>
35.158 + </div>
35.159 + <div class="col-sm-6 col-md-4">
35.160 + <div class="thumbnail">
35.161 + <img src="ios_logo.jpg" width="120" height="120" alt="Android">
35.162 + <div class="caption">
35.163 + <h3>iBrwsr</h3>
35.164 + <p>
35.165 + This application has been packaged to run on your iPhone
35.166 + or iPad and made available on AppStore.
35.167 + In this mode it
35.168 + uses <a target="_blank" href="http://www.robovm.org">RoboVM</a>
35.169 + virtual machine to execute Java code natively.
35.170 + It uses iOS WebView to display the UI and execute
35.171 + generated JavaScript. Both these components are
35.172 + bound together via <a target="_blank"
35.173 + href="http://wiki.apidesign.org/wiki/IBrwsr">
35.174 + iBrwsr</a> library.
35.175 + </p>
35.176 + <p>
35.177 + <a href="https://itunes.apple.com/us/app/fair-minesweeper/id903688146"
35.178 + target="_blank"
35.179 + class="btn btn-primary" role="button"
35.180 + >Install »</a>
35.181 + </p>
35.182 + </div>
35.183 + </div>
35.184 + </div>
35.185 + <div class="col-sm-6 col-md-4">
35.186 + <div class="thumbnail">
35.187 + <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
35.188 + <div class="caption">
35.189 + <h3>Develop Own App!</h3>
35.190 + <p>
35.191 + One can package this application as a
35.192 + <a href="http://plugins.netbeans.org/plugin/53864/"
35.193 + target="_blank"
35.194 + >plugin for NetBeans</a> or
35.195 + use <a href="http://www.netbeans.org" target="_blank">
35.196 + NetBeans</a> IDE to create
35.197 + application like this yourself. Enjoy the
35.198 + power of <em>HTML</em> and <em>Java</em>.
35.199 + Write your applications once and deploy and display
35.200 + them on any device!
35.201 + </p>
35.202 + <p>
35.203 + <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
35.204 + target="_blank"
35.205 + class="btn btn-primary" role="button"
35.206 + >Develop »</a>
35.207 + </p>
35.208 + </div>
35.209 + </div>
35.210 + </div>
35.211 +</div>
35.212 <!-- boot bck2brwsr -->
35.213 <script type="text/javascript" src="bck2brwsr.js"></script>
35.214 <script>
35.215 - var vm = bck2brwsr('${project.build.finalName}.jar');
35.216 - vm.loadClass('org.apidesign.demo.minesweeper.MainBrwsr');
35.217 + var vm = bck2brwsr('minesweeper.js');
35.218 + var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
35.219 + c.invoke('main');
35.220 </script>
35.221 +
35.222 </body>
35.223 </html>
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/minesweeper/src/main/webapp/pages/index_cs.html Fri Oct 31 23:46:16 2014 +0100
36.3 @@ -0,0 +1,247 @@
36.4 +<!--
36.5 +
36.6 + The MIT License (MIT)
36.7 +
36.8 + Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
36.9 +
36.10 + Permission is hereby granted, free of charge, to any person obtaining a copy
36.11 + of this software and associated documentation files (the "Software"), to deal
36.12 + in the Software without restriction, including without limitation the rights
36.13 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36.14 + copies of the Software, and to permit persons to whom the Software is
36.15 + furnished to do so, subject to the following conditions:
36.16 +
36.17 + The above copyright notice and this permission notice shall be included in
36.18 + all copies or substantial portions of the Software.
36.19 +
36.20 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36.21 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36.22 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36.23 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36.24 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36.25 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
36.26 + THE SOFTWARE.
36.27 +
36.28 +-->
36.29 +<!DOCTYPE html>
36.30 +<html>
36.31 + <head>
36.32 + <title>Férové miny</title>
36.33 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
36.34 + <link href="bootstrap.css" rel="stylesheet">
36.35 + <link href="bootstrap-responsive.css" rel="stylesheet">
36.36 + <link href="mines.css" rel="stylesheet">
36.37 + <!-- Target tablets -->
36.38 + <link href="mines-tablet-large.css"
36.39 + media="(min-width:640px), (min-height:660px)"
36.40 + rel="stylesheet" />
36.41 + <link href="mines-tablet-small.css"
36.42 + media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)"
36.43 + rel="stylesheet" />
36.44 + <!-- Target phones -->
36.45 + <link href="mines-phone-large.css"
36.46 + media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)"
36.47 + rel="stylesheet" />
36.48 + <link href="mines-phone-small.css"
36.49 + media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)"
36.50 + rel="stylesheet" />
36.51 + <link href="mines-phone-smaller.css"
36.52 + media="(max-width:300px), (max-height:300px)"
36.53 + rel="stylesheet" />
36.54 + </head>
36.55 + <body>
36.56 + <div class="navbar">
36.57 + <div class="navbar-inner">
36.58 + <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
36.59 + <img height="20" width="20" src="DukeSweeper.png">
36.60 + <span class="hidden-phone">Miny</span>
36.61 + </a>
36.62 + <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
36.63 + <span>↻</span>
36.64 + <span class="info-text">Hra</span>
36.65 + </button>
36.66 + <button class="hidden-phone btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
36.67 + <span>✗</span>
36.68 + <span>Vzdát</span>
36.69 + </button>
36.70 + <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
36.71 + <span>⚠</span>
36.72 + <span class="info-text">Označkovat</span>
36.73 + </button>
36.74 + </div>
36.75 + </div>
36.76 +
36.77 +
36.78 + <script type="text/html" id="field">
36.79 + <center>
36.80 + <table class="field" data-bind="css: gameStyle">
36.81 + <tbody>
36.82 + <!-- ko foreach: rows -->
36.83 + <tr>
36.84 + <!-- ko foreach: columns -->
36.85 + <td data-bind="css: style, click: $parents[1].click" >
36.86 + <div></div>
36.87 + </td>
36.88 + <!-- /ko -->
36.89 + </tr>
36.90 + <!-- /ko -->
36.91 + </tbody>
36.92 + </table>
36.93 + </center>
36.94 + </script>
36.95 +
36.96 + <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
36.97 +
36.98 + <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
36.99 + <div class="container">
36.100 + <h1>Ukázka HTML/Java technologie</h1>
36.101 +
36.102 + <p>Na první pohled se jedná o staré dobré <em>miny</em>.
36.103 + Bližší pohled však odhalí revoluční technologii, jež
36.104 + umožňuje programovat logiku aplikace v <strong>Javě</strong>
36.105 + a uživatelské rozhraní definovat v <strong>HTML</strong>.
36.106 + To vše na jakémkoli zařízení schopném zobrazit moderní
36.107 + <strong>HTML5</strong> prohlížeč.
36.108 + </p>
36.109 + <p><a class="btn btn-primary btn-lg" role="button"
36.110 + target="_blank" href="http://html.java.net"
36.111 + >Navštívit stránky projektu</a>
36.112 + </p>
36.113 + </div>
36.114 + </div>
36.115 +
36.116 + <div class="container" data-bind="visible: !fieldShowing()">
36.117 + <div>
36.118 + <div class="col-md-4">
36.119 + <h2>Miny</h2>
36.120 + <p>
36.121 + Odhalte deset políček jež skrývají miny
36.122 + a označte je znakem ⚠.
36.123 + Dotykem políčka se zjistí,
36.124 + zda-li je na něm mina či kolik min se
36.125 + nachází v sousedních osmi políčkách.
36.126 + Nespoléhejte na náhodu,
36.127 + tato verze min dokáže detekovat
36.128 + náhodné hádání a v takovém případě přerovnat miny.
36.129 + Tato hra je <b>fér</b>!
36.130 + </p>
36.131 + <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Hrát »</a></p>
36.132 + </div>
36.133 + <div class="col-md-4">
36.134 + <h2>Dokumentace</h2>
36.135 + <p>
36.136 + Chcete-li psát aplikace jako je tato
36.137 + (tedy používat <strong>Javu</strong> a <strong>HTML</strong>)
36.138 + můžete se nyní dozvědět něco o knihovnách, které
36.139 + to umožňují. Následující odkaz Vás zavede
36.140 + stránky s dokumentací.
36.141 + </p>
36.142 + <p><a class="btn btn-default"
36.143 + target="_blank" href="http://bits.netbeans.org/html+java/"
36.144 + role="button">Více »</a></p>
36.145 + </div>
36.146 + <div class="col-md-4">
36.147 + <h2>Verze pro prohlížeč</h2>
36.148 + <p>
36.149 + Tato technologie je primárně určena pro
36.150 + klasické osobní počítače či pro tablety a telefony.
36.151 + Přesto je však možné spustit tu samou aplikaci
36.152 + s nezměným kódem v prohlížeči. Je k tomu potřeba
36.153 + implementace <b>Java</b> virtuálního stroje zvaná
36.154 + <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>.
36.155 + </p>
36.156 + <p><a class="btn btn-default"
36.157 + target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
36.158 + role="button">Vyzkoušet »</a></p>
36.159 + </div>
36.160 + </div>
36.161 + </div>
36.162 +<div class="container" data-bind="visible: !fieldShowing()">
36.163 + <div class="col-sm-6 col-md-4">
36.164 + <div class="thumbnail">
36.165 + <img src="android_logo.jpg" width="120" height="120" alt="Android">
36.166 + <div class="caption">
36.167 + <h3>DlvkBrwsr</h3>
36.168 + <p>
36.169 + Tato apliace byla přeložena pro Váš telefon se systémem Android
36.170 + a je dostupná na Google Play! tržišti. V této konfiguraci
36.171 + se používá virtuální stroj Dalvik pro spouštění <b>Java</b> kódu
36.172 + a Androidí WebView k zobrazení uživatelského rozhraní a
36.173 + interpretaci generovaného JavaScriptu. Tyto komponenty jsou
36.174 + spojeny dohromady pomocí <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
36.175 + DlvkBrwsr</a> technologie.
36.176 + </p>
36.177 + <p>
36.178 + <a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
36.179 + target="_blank"
36.180 + class="btn btn-primary" role="button"
36.181 + >Instalovat »</a>
36.182 + </p>
36.183 + </div>
36.184 + </div>
36.185 + </div>
36.186 + <div class="col-sm-6 col-md-4">
36.187 + <div class="thumbnail">
36.188 + <img src="ios_logo.jpg" width="120" height="120" alt="Android">
36.189 + <div class="caption">
36.190 + <h3>iBrwsr</h3>
36.191 + <p>
36.192 + Tato aplikace byla přeložena a zabalena tak, aby běžela na
36.193 + Vašem iPhonu
36.194 + nebo iPadu a je dostupná na tržišti AppStore.
36.195 + V této konfiguraci se používá
36.196 + virtuální stroj <a target="_blank" href="http://www.robovm.org">RoboVM</a>
36.197 + pro přeložení <b>Java</b> kódu do nativního formátu.
36.198 + Pro zobrazení a provádění vygenerovaného JavaScriptu
36.199 + se využívá iOS WebView. Obě tyto komponenty jsou spojeny
36.200 + pomocí <a target="_blank"
36.201 + href="http://wiki.apidesign.org/wiki/IBrwsr">
36.202 + iBrwsr</a> knihovny.
36.203 + </p>
36.204 + <p>
36.205 + <a href="https://itunes.apple.com/us/app/fair-minesweeper/id903688146"
36.206 + target="_blank"
36.207 + class="btn btn-primary" role="button"
36.208 + >Instalovat »</a>
36.209 + </p>
36.210 + </div>
36.211 + </div>
36.212 + </div>
36.213 + <div class="col-sm-6 col-md-4">
36.214 + <div class="thumbnail">
36.215 + <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
36.216 + <div class="caption">
36.217 + <h3>Vyvíjejte své aplikace!</h3>
36.218 + <p>
36.219 + Tuto aplikaci lze zabalit jako
36.220 + <a href="http://plugins.netbeans.org/plugin/53864/"
36.221 + target="_blank"
36.222 + >rozšíření pro NetBeans</a> a nebo
36.223 + lze použít vývojové prostředí
36.224 + <a href="http://www.netbeans.org" target="_blank">
36.225 + NetBeans</a> k vytvoření své vlastní aplikace,
36.226 + jež bude využívat synergie
36.227 + <em>HTML</em> a <em>Javy</em>.
36.228 + Pište své aplikace jednou a zobrazte je na
36.229 + každém zařízení schopném zobrazit <em>HTML</em>!
36.230 + </p>
36.231 + <p>
36.232 + <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
36.233 + target="_blank"
36.234 + class="btn btn-primary" role="button"
36.235 + >Vyvíjejte »</a>
36.236 + </p>
36.237 + </div>
36.238 + </div>
36.239 + </div>
36.240 +</div>
36.241 + <!-- boot bck2brwsr -->
36.242 + <script type="text/javascript" src="bck2brwsr.js"></script>
36.243 + <script>
36.244 + var vm = bck2brwsr('minesweeper.js');
36.245 + var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
36.246 + c.invoke('main');
36.247 + </script>
36.248 +
36.249 + </body>
36.250 +</html>
37.1 Binary file minesweeper/src/main/webapp/pages/ios_logo.jpg has changed
38.1 --- a/minesweeper/src/main/webapp/pages/mines-phone-small.css Thu Mar 20 10:55:11 2014 +0100
38.2 +++ b/minesweeper/src/main/webapp/pages/mines-phone-small.css Fri Oct 31 23:46:16 2014 +0100
38.3 @@ -22,9 +22,9 @@
38.4 * THE SOFTWARE.
38.5 */
38.6 table.field td {
38.7 - padding: 4px;
38.8 - width: 18px;
38.9 - height: 18px;
38.10 + padding: 3px;
38.11 + width: 16px;
38.12 + height: 16px;
38.13 font-size: 1.5em;
38.14 }
38.15 h1 {
38.16 @@ -51,3 +51,6 @@
38.17 .col-md-1 {
38.18 width: 100%;
38.19 }
38.20 +.info-text {
38.21 + font-size: xx-small;
38.22 +}
39.1 --- a/minesweeper/src/main/webapp/pages/mines-phone-smaller.css Thu Mar 20 10:55:11 2014 +0100
39.2 +++ b/minesweeper/src/main/webapp/pages/mines-phone-smaller.css Fri Oct 31 23:46:16 2014 +0100
39.3 @@ -22,11 +22,11 @@
39.4 * THE SOFTWARE.
39.5 */
39.6 table.field td {
39.7 - padding: 2px;
39.8 - width: 10px;
39.9 - height: 10px;
39.10 + padding: 3px;
39.11 + width: 13px;
39.12 + height: 13px;
39.13 line-height: 10px;
39.14 - font-size: 0.8em;
39.15 + font-size: 1em;
39.16 }
39.17 h1 {
39.18 font-size: 8px;
39.19 @@ -52,3 +52,6 @@
39.20 .col-md-1 {
39.21 width: 100%;
39.22 }
39.23 +.info-text {
39.24 + font-size: xx-small;
39.25 +}
40.1 --- a/minesweeper/src/main/webapp/pages/mines.css Thu Mar 20 10:55:11 2014 +0100
40.2 +++ b/minesweeper/src/main/webapp/pages/mines.css Fri Oct 31 23:46:16 2014 +0100
40.3 @@ -33,6 +33,10 @@
40.4 background-color: #fafafa;
40.5 }
40.6
40.7 +table {
40.8 + table-layout: fixed;
40.9 +}
40.10 +
40.11 table.field {
40.12 }
40.13 table.field td {
40.14 @@ -45,8 +49,56 @@
40.15 font-size:4em;
40.16 }
40.17
40.18 +table.field td div {
40.19 + position: relative;
40.20 + left: 0;
40.21 + top: 0;
40.22 +}
40.23 +
40.24 +@-moz-keyframes blinker {
40.25 + 0% { opacity: 0.9; }
40.26 + 50% { opacity: 0.1; }
40.27 + 100% { opacity: 0.9; }
40.28 +}
40.29 +
40.30 +@-webkit-keyframes blinker {
40.31 + 0% { opacity: 0.9; }
40.32 + 50% { opacity: 0.1; }
40.33 + 100% { opacity: 0.9; }
40.34 +}
40.35 +
40.36 +@keyframes blinker {
40.37 + 0% { opacity: 0.9; }
40.38 + 50% { opacity: 0.1; }
40.39 + 100% { opacity: 0.9; }
40.40 +}
40.41 +table.MARKING td.UNKNOWN div:before {
40.42 + content: "\0026a0";
40.43 + color: #802420;
40.44 +
40.45 + -webkit-animation-name: blinker;
40.46 + -webkit-animation-duration: 3s;
40.47 + -webkit-animation-timing-function: linear;
40.48 + -webkit-animation-iteration-count: infinite;
40.49 +
40.50 + -moz-animation-name: blinker;
40.51 + -moz-animation-duration: 3s;
40.52 + -moz-animation-timing-function: linear;
40.53 + -moz-animation-iteration-count: infinite;
40.54 +
40.55 + animation-name: blinker;
40.56 + animation-duration: 3s;
40.57 + animation-timing-function: linear;
40.58 + animation-iteration-count: infinite;
40.59 +}
40.60 +
40.61 table.field td.UNKNOWN {
40.62 background-color: #D6E4E1;
40.63 + color: #D6E4E1;
40.64 + cursor: pointer;
40.65 +}
40.66 +table.field td.MARKED {
40.67 + background-color: #D6E4E1;
40.68 cursor: pointer;
40.69 }
40.70 table.field td.EXPLOSION {
40.71 @@ -55,6 +107,48 @@
40.72 table.field td.DISCOVERED {
40.73 background-color: #9DB2B1;
40.74 }
40.75 +
40.76 +table.PLAYING td.UNKNOWN div::after {
40.77 + content: "\0026a0";
40.78 + visibility: hidden;
40.79 +}
40.80 +table.field td.EXPLOSION div::after {
40.81 + content: "\002717";
40.82 +}
40.83 +table.field td.DISCOVERED div::after {
40.84 + content: "\002714";
40.85 +}
40.86 +table.field td.MARKED div::after {
40.87 + content: "\0026a0";
40.88 +}
40.89 +table.field td.N_0 div::after {
40.90 + content: "\0026a0";
40.91 + visibility: hidden;
40.92 +}
40.93 +table.field td.N_1 div::after {
40.94 + content: "\002780";
40.95 +}
40.96 +table.field td.N_2 div::after {
40.97 + content: "\002781";
40.98 +}
40.99 +table.field td.N_3 div::after {
40.100 + content: "\002782";
40.101 +}
40.102 +table.field td.N_4 div::after {
40.103 + content: "\002783";
40.104 +}
40.105 +table.field td.N_5 div::after {
40.106 + content: "\002784";
40.107 +}
40.108 +table.field td.N_6 div::after {
40.109 + content: "\002785";
40.110 +}
40.111 +table.field td.N_7 div::after {
40.112 + content: "\002786";
40.113 +}
40.114 +table.field td.N_8 div::after {
40.115 + content: "\002787";
40.116 +}
40.117 .but-orientation {
40.118 margin-top:20px;
40.119 }
41.1 Binary file minesweeper/src/main/webapp/pages/netbeans_logo.jpg has changed
42.1 Binary file minesweeper/src/main/webapp/pages/oops.mp3 has changed
43.1 --- a/minesweeper/src/test/java/org/apidesign/demo/minesweeper/MinesModelTest.java Thu Mar 20 10:55:11 2014 +0100
43.2 +++ b/minesweeper/src/test/java/org/apidesign/demo/minesweeper/MinesModelTest.java Fri Oct 31 23:46:16 2014 +0100
43.3 @@ -45,6 +45,64 @@
43.4 assertEquals(cnt, 10, "Ten mines");
43.5 }
43.6
43.7 + @Test public void clickRemovesMarkedSign() {
43.8 + Mines m = new Mines();
43.9 + m.init(10, 10, 10);
43.10 +
43.11 + final Square sq = m.getRows().get(5).getColumns().get(5);
43.12 + MinesModel.markMine(m);
43.13 + MinesModel.click(m, sq);
43.14 +
43.15 + assertEquals(sq.getState(), SquareType.MARKED, "Changed to marked");
43.16 +
43.17 + MinesModel.click(m, sq);
43.18 +
43.19 + assertEquals(sq.getState(), SquareType.UNKNOWN, "Changed back to unknown");
43.20 + }
43.21 +
43.22 + @Test public void gameWonWhenAllMarked() {
43.23 + Mines m = new Mines();
43.24 + m.init(10, 10, 10);
43.25 +
43.26 + for (Row row : m.getRows()) {
43.27 + for (Square sq : row.getColumns()) {
43.28 + if (sq.isMine()) {
43.29 + MinesModel.markMine(m);
43.30 + MinesModel.click(m, sq);
43.31 + }
43.32 + }
43.33 + }
43.34 +
43.35 + assertEquals(m.getState(), MinesModel.GameState.WON, "All mines found. You have won!");
43.36 + }
43.37 +
43.38 + @Test public void gameNotWonWhenTooMuchIsMarked() {
43.39 + Mines m = new Mines();
43.40 + m.init(10, 10, 10);
43.41 +
43.42 + Square additional = null;
43.43 + for (Row row : m.getRows()) {
43.44 + for (Square sq : row.getColumns()) {
43.45 + if (sq.isMine()) {
43.46 + MinesModel.markMine(m);
43.47 + MinesModel.click(m, sq);
43.48 + } else if (additional == null) {
43.49 + MinesModel.markMine(m);
43.50 + MinesModel.click(m, additional = sq);
43.51 + }
43.52 + }
43.53 + }
43.54 +
43.55 + assertEquals(m.getState(), MinesModel.GameState.IN_PROGRESS, "One additional mine is marked!");
43.56 +
43.57 + // remove the mark
43.58 + MinesModel.click(m, additional);
43.59 +
43.60 + assertEquals(m.getState(), MinesModel.GameState.WON, "All mines found. You have won!");
43.61 +
43.62 +
43.63 + }
43.64 +
43.65 @Test public void bombsSet() {
43.66 Mines m = new Mines();
43.67 m.init(10, 10, 0);
44.1 --- a/pom.xml Thu Mar 20 10:55:11 2014 +0100
44.2 +++ b/pom.xml Fri Oct 31 23:46:16 2014 +0100
44.3 @@ -13,9 +13,10 @@
44.4 </parent>
44.5 <properties>
44.6 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44.7 - <net.java.html.version>0.7.5</net.java.html.version>
44.8 - <bck2brwsr.version>0.8.1</bck2brwsr.version>
44.9 - <teavm.version>0.1</teavm.version>
44.10 + <net.java.html.version>1.0</net.java.html.version>
44.11 + <nb.html.version>1.0</nb.html.version>
44.12 + <bck2brwsr.version>0.11</bck2brwsr.version>
44.13 + <teavm.version>0.2.1</teavm.version>
44.14 <license>COPYING</license>
44.15 </properties>
44.16 <modules>