Skip to content
Permalink
Browse files
Updated MinesModel.
- updated namespaces
- added new computed property stateStr
- added new function urlControlsJS
- removed functions urlBck2B, urlBrowserSweeper, urlPresenters, urlGooglePlay, urlRoboVM, urlAppStore, urlNetBeansPlugin, urlNetBeans and urlDevelop
- static method main changed to onPageLoad
  • Loading branch information
controlsjs committed Apr 20, 2016
1 parent 590cbda commit 55549f4a68019706a80406c79f6af270f11410da
Showing 1 changed file with 11 additions and 60 deletions.
@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apidesign.demo.minesweeper;
package com.controlsjs.demo.minesweeper;

import java.util.ArrayList;
import java.util.List;
@@ -32,7 +32,7 @@
import net.java.html.json.ModelOperation;
import net.java.html.json.Property;
import net.java.html.sound.AudioClip;
import org.apidesign.demo.minesweeper.js.OpenURL;
import com.controlsjs.demo.minesweeper.js.OpenURL;

/**
* Model of the mine field.
@@ -101,6 +101,11 @@ static boolean gameInProgress(GameState state) {
return state == GameState.IN_PROGRESS;
}

@ComputedProperty
static String stateStr(GameState state) {
return state == null ? "" : state.toString();
}

@Function
static void showHelp(Mines model) {
model.setState(null);
@@ -306,67 +311,13 @@ static void click(Mines model, Square data) {

@Function
static void urlProjectPage(Mines model) {
String url = "https://dukescript.com";
openURL(url);
}

@Function
static void urlProjectDoc(Mines model) {
String url = "https://dukescript.com/documentation.html"; // NOI18N
openURL(url);
}

@Function
static void urlBck2Brwsr(Mines model) {
String url = "http://bck2brwsr.apidesign.org"; // NOI18N
openURL(url);
}

@Function
static void urlBrowserSweeper(Mines model) {
String url = "http://xelfi.cz/minesweeper/bck2brwsr/"; // NOI18N
openURL(url);
}

@Function
static void urlPresenters(Mines model) {
String url = "https://github.com/dukescript/dukescript-presenters"; // NOI18N
openURL(url);
}

@Function
static void urlGooglePlay(Mines model) {
String url = "https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"; // NOI18N
openURL(url);
}

@Function
static void urlRoboVM(Mines model) {
String url = "http://www.robovm.org"; // NOI18N
openURL(url);
}

@Function
static void urlAppStore(Mines model) {
String url = "https://itunes.apple.com/us/app/fair-minesweeper/id903688146"; // NOI18N
openURL(url);
}

@Function
static void urlNetBeansPlugin(Mines model) {
String url = "http://plugins.netbeans.org/plugin/53864/"; // NOI18N
openURL(url);
}

@Function
static void urlNetBeans(Mines model) {
String url = "http://www.netbeans.org"; // NOI18N
String url = "http://dukescript.com";
openURL(url);
}

@Function
static void urlDevelop(Mines model) {
String url = "https://dukescript.com/getting_started.html"; // NOI18N
static void urlControlsJS(Mines model) {
String url = "http://controlsjs.com";
openURL(url);
}

@@ -570,7 +521,7 @@ private static boolean allMarked(Mines m) {

private static Mines ui;

public static void main(String... args) throws Exception {
public static void onPageLoad() throws Exception {
ui = new Mines();
ui.applyBindings();
}

0 comments on commit 55549f4

Please sign in to comment.