Permalink
Browse files

Merge pull request #21 from mdwoolley/master

About screen added to TouchTicTacToe
  • Loading branch information...
2 parents b087599 + b73fe3d commit fcc8ef9fc178e2e4ab1c2ebfc11680031d6651b0 @timwindsor timwindsor committed Sep 1, 2012
Showing with 74 additions and 13 deletions.
  1. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/Constants.class
  2. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/TouchTicTacToe.class
  3. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/commands/AboutCommand.class
  4. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/game/GameState.class
  5. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/GameScreen$1.class
  6. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/GameScreen$2.class
  7. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/GameScreen$3.class
  8. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/GameScreen.class
  9. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/StartGameScreen$1.class
  10. BIN NFC/TouchTicTacToe/bin/nfc/sample/tictactoe/ui/StartGameScreen.class
  11. BIN NFC/TouchTicTacToe/deliverables/Standard/7.1.0/TouchTicTacToe-1.debug
  12. BIN NFC/TouchTicTacToe/deliverables/Standard/7.1.0/TouchTicTacToe.cod
  13. BIN NFC/TouchTicTacToe/deliverables/Standard/7.1.0/TouchTicTacToe.debug
  14. +6 −6 NFC/TouchTicTacToe/deliverables/Standard/7.1.0/TouchTicTacToe.jad
  15. BIN NFC/TouchTicTacToe/deliverables/Standard/7.1.0/TouchTicTacToe.jar
  16. BIN NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe-1.cod
  17. BIN NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe-1.debug
  18. BIN NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe.cod
  19. BIN NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe.debug
  20. +6 −6 NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe.jad
  21. BIN NFC/TouchTicTacToe/deliverables/Web/7.1.0/TouchTicTacToe.jar
  22. +1 −1 NFC/TouchTicTacToe/src/nfc/sample/tictactoe/Constants.java
  23. +40 −0 NFC/TouchTicTacToe/src/nfc/sample/tictactoe/commands/AboutCommand.java
  24. +11 −0 NFC/TouchTicTacToe/src/nfc/sample/tictactoe/ui/GameScreen.java
  25. +10 −0 NFC/TouchTicTacToe/src/nfc/sample/tictactoe/ui/StartGameScreen.java
@@ -2,18 +2,18 @@ MIDlet-Name: TouchTicTacToe
MIDlet-Version: 1.0.0
MIDlet-Vendor: BlackBerry Developer
MIDlet-Jar-URL: TouchTicTacToe.jar
-MIDlet-Jar-Size: 247594
+MIDlet-Jar-Size: 249747
MicroEdition-Profile: MIDP-2.0
MicroEdition-Configuration: CLDC-1.1
MIDlet-1: ,img/icon4.png,
RIM-MIDlet-Flags-1: 0
Manifest-Version: 1.0
RIM-COD-URL: TouchTicTacToe.cod
-RIM-COD-Size: 61640
-RIM-COD-Creation-Time: 1345031668
+RIM-COD-Size: 61656
+RIM-COD-Creation-Time: 1346403036
RIM-COD-Module-Name: TouchTicTacToe
RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_nfc
-RIM-COD-SHA1: 45 d2 72 b1 bb 88 15 da 61 ec 96 29 3f b0 41 ea a5 a7 ab f9
+RIM-COD-SHA1: ad 04 2d 5a 84 0f b9 5a d0 1e b9 e7 b2 54 e7 dd 2b 39 68 6e
RIM-COD-URL-1: TouchTicTacToe-1.cod
-RIM-COD-Size-1: 23668
-RIM-COD-SHA1-1: ea 05 58 83 38 07 b6 4f 85 f5 ee 48 ac 5d e6 0f 04 5f ee e9
+RIM-COD-Size-1: 24700
+RIM-COD-SHA1-1: 2a 2e f4 76 d3 c7 66 42 d5 f1 65 36 68 08 f0 2b a1 2b 97 72
@@ -2,18 +2,18 @@ MIDlet-Name: TouchTicTacToe
MIDlet-Version: 1.0.0
MIDlet-Vendor: BlackBerry Developer
MIDlet-Jar-URL: TouchTicTacToe.jar
-MIDlet-Jar-Size: 247594
+MIDlet-Jar-Size: 249747
MicroEdition-Profile: MIDP-2.0
MicroEdition-Configuration: CLDC-1.1
MIDlet-1: ,img/icon4.png,
RIM-MIDlet-Flags-1: 0
Manifest-Version: 1.0
RIM-COD-URL: TouchTicTacToe.cod
-RIM-COD-Size: 61640
-RIM-COD-Creation-Time: 1345031668
+RIM-COD-Size: 61656
+RIM-COD-Creation-Time: 1346403036
RIM-COD-Module-Name: TouchTicTacToe
RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_nfc
-RIM-COD-SHA1: 45 d2 72 b1 bb 88 15 da 61 ec 96 29 3f b0 41 ea a5 a7 ab f9
+RIM-COD-SHA1: ad 04 2d 5a 84 0f b9 5a d0 1e b9 e7 b2 54 e7 dd 2b 39 68 6e
RIM-COD-URL-1: TouchTicTacToe-1.cod
-RIM-COD-Size-1: 23668
-RIM-COD-SHA1-1: ea 05 58 83 38 07 b6 4f 85 f5 ee 48 ac 5d e6 0f 04 5f ee e9
+RIM-COD-Size-1: 24700
+RIM-COD-SHA1-1: 2a 2e f4 76 d3 c7 66 42 d5 f1 65 36 68 08 f0 2b a1 2b 97 72
@@ -18,7 +18,7 @@
public interface Constants {
- public static final String MYAPP_VERSION = "1.0.2";
+ public static final String MYAPP_VERSION = "1.0.3";
public static final String MYAPP_NAME = "Touch Tic Tac Toe";
public static final String [] WINNER_MESSAGE = {"YOU HAVE WON!!","Touch devices to start new game"};
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package nfc.sample.tictactoe.commands;
+import net.rim.device.api.command.AlwaysExecutableCommand;
+import net.rim.device.api.command.ReadOnlyCommandMetadata;
+import net.rim.device.api.ui.UiApplication;
+import nfc.sample.tictactoe.Constants;
+import nfc.sample.tictactoe.Utilities;
+
+public class AboutCommand extends AlwaysExecutableCommand {
+
+
+ public AboutCommand() {
+ }
+
+ public void execute(ReadOnlyCommandMetadata metadata, Object context) {
+
+ Utilities.log("XXXX AboutCommand - execute");
+
+ synchronized(UiApplication.getUiApplication().getEventLock()) {
+ synchronized (UiApplication.getEventLock()) {
+ Utilities.popupMessage("TouchTicTacToe V"+Constants.MYAPP_VERSION+"\n\n\nMartin Woolley (@mdwrim)\n\nJohn Murray (@jcmrim)");
+ }
+ }
+ }
+
+}
@@ -15,6 +15,7 @@
*/
package nfc.sample.tictactoe.ui;
+import net.rim.device.api.command.Command;
import net.rim.device.api.io.nfc.NFCException;
import net.rim.device.api.io.nfc.ndef.NDEFMessage;
import net.rim.device.api.io.nfc.push.NDEFPushStatusCallback;
@@ -23,13 +24,16 @@
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FocusChangeListener;
import net.rim.device.api.ui.Graphics;
+import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.AbsoluteFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;
+import net.rim.device.api.util.StringProvider;
import nfc.sample.tictactoe.Constants;
import nfc.sample.tictactoe.Utilities;
+import nfc.sample.tictactoe.commands.AboutCommand;
import nfc.sample.tictactoe.commands.SelectTileCommand;
import nfc.sample.tictactoe.game.GameState;
import nfc.sample.tictactoe.game.GameStateChangeListener;
@@ -71,6 +75,8 @@
private Bitmap stale_mate_nought_bmp;
private Bitmap cross_unfocused;
private Bitmap nought_unfocused;
+
+ private MenuItem mi_about = new MenuItem(new StringProvider("About"), 110, 10);
public synchronized static GameScreen getInstance(int player_no) {
Utilities.log("XXXX GameScreen.getInstance(" + player_no + "): height=" + Display.getHeight() + ",width=" + Display.getWidth());
@@ -98,6 +104,11 @@ private GameScreen() {
int width = Display.getWidth();
int height = Display.getHeight();
uiconfig = UiConfigFactory.getUiConfig(width, height);
+
+ mi_about.setCommandContext(this);
+ mi_about.setCommand(new Command(new AboutCommand()));
+ addMenuItem(mi_about);
+
Bitmap blank_unfocused = BitmapFactory.getBlankUnfocused();
Bitmap blank_focused = BitmapFactory.addStateIndicator(blank_unfocused, Constants.FOCUSED_COLOUR);
@@ -15,18 +15,22 @@
*/
package nfc.sample.tictactoe.ui;
+import net.rim.device.api.command.Command;
import net.rim.device.api.io.nfc.NFCException;
import net.rim.device.api.io.nfc.ndef.NDEFMessage;
import net.rim.device.api.io.nfc.push.NDEFPushStatusCallback;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.AbsoluteFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;
+import net.rim.device.api.util.StringProvider;
import nfc.sample.tictactoe.Constants;
import nfc.sample.tictactoe.Utilities;
+import nfc.sample.tictactoe.commands.AboutCommand;
import nfc.sample.tictactoe.protocol.GameMessageProcessor;
import nfc.sample.tictactoe.protocol.GameProtocol;
import nfc.sample.tictactoe.protocol.ProtocolMessage;
@@ -37,11 +41,17 @@
private GameProtocol proto;
private Bitmap new_game_screen;
private TimedLabelField status_message;
+ private MenuItem mi_about = new MenuItem(new StringProvider("About"), 110, 10);
private ProtocolMessageMasterBid my_bid;
public StartGameScreen() {
super(Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH | Field.FIELD_HCENTER | Field.FIELD_VCENTER);
+
+ mi_about.setCommandContext(this);
+ mi_about.setCommand(new Command(new AboutCommand()));
+ addMenuItem(mi_about);
+
AbsoluteFieldManager abmgr = new AbsoluteFieldManager();
new_game_screen = BitmapFactory.getNewGameScreen();
Background bg_new_game = BackgroundFactory.createBitmapBackground(new_game_screen);

0 comments on commit fcc8ef9

Please sign in to comment.