use of net.rim.device.api.ui.container.MainScreen in project Samples-for-Java by blackberry.
the class SendCommand method execute.
public void execute(ReadOnlyCommandMetadata metadata, Object context) {
synchronized (UiApplication.getUiApplication().getEventLock()) {
MainScreen screen = new ClientTextScreen();
UiApplication.getUiApplication().pushScreen(screen);
}
}
use of net.rim.device.api.ui.container.MainScreen in project Samples-for-Java by blackberry.
the class ResponderCommand method execute.
public void execute(ReadOnlyCommandMetadata metadata, Object context) {
UiApplication.getUiApplication();
synchronized (UiApplication.getEventLock()) {
MainScreen screen = new NfcSnepResponderScreen(Constants.VCARD_RESPONDER);
UiApplication.getUiApplication().pushScreen(screen);
}
}
use of net.rim.device.api.ui.container.MainScreen in project Samples-for-Java by blackberry.
the class CreateCustomTagCommand method execute.
public void execute(ReadOnlyCommandMetadata metadata, Object context) {
synchronized (UiApplication.getUiApplication().getEventLock()) {
MainScreen screen = new CustomTagScreen();
UiApplication.getUiApplication().pushScreen(screen);
}
}
use of net.rim.device.api.ui.container.MainScreen in project Samples-for-Java by blackberry.
the class EmulateSrCommand method execute.
public void execute(ReadOnlyCommandMetadata metadata, Object context) {
synchronized (UiApplication.getUiApplication().getEventLock()) {
MainScreen screen = new NfcVirtTargScreen(Constants.EMULATE_SR);
UiApplication.getUiApplication().pushScreen(screen);
}
}
use of net.rim.device.api.ui.container.MainScreen in project Samples-for-Java by blackberry.
the class GameScreen method checkBids.
private void checkBids() {
Utilities.log("XXXX checkBids: game_state.getMy_bid_sent()=" + game_state.getMy_bid_sent() + ",game_state.getOther_bid_received()=" + game_state.getOther_bid_received());
if (game_state.getMy_bid_sent() == null || game_state.getOther_bid_received() == null) {
return;
}
int device_role = 0;
if (my_bid.getBid() > other_bid.getBid()) {
Utilities.log("XXXX won the bid: player 1");
device_role = Constants.PLAYER_1;
} else {
if (my_bid.getBid() < other_bid.getBid()) {
Utilities.log("XXXX lost the bid: player 2");
device_role = Constants.PLAYER_2;
} else {
setStatusMessage("It didn't work, please try again!");
return;
}
}
try {
proto.disableMessaging();
} catch (NFCException e) {
Utilities.log("XXXX GameScreen:" + e.getClass().getName() + ":" + e.getMessage());
setStatusMessage("It didn't work, try again!");
return;
}
resetBidStateTracking();
final int player_no = device_role;
final MainScreen next_screen;
if (player_no == Constants.PLAYER_2) {
next_screen = GameScreen.getInstance(player_no);
} else {
next_screen = new SymbolSelectionScreen();
}
final GameScreen this_screen = this;
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
UiApplication.getUiApplication().popScreen(this_screen);
}
});
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
UiApplication.getUiApplication().pushScreen(next_screen);
}
});
}
Aggregations