本文整理汇总了Java中javax.microedition.lcdui.Command.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Command.equals方法的具体用法?Java Command.equals怎么用?Java Command.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.microedition.lcdui.Command
的用法示例。
在下文中一共展示了Command.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if (c.equals(SELECT_FILE_COMMAND)) {
List curr = (List) d;
currFile = curr.getString(curr.getSelectedIndex());
new HandledThread(new Runnable() {
public void run() {
if (currFile.endsWith(SEP_STR) || currFile.equals(UP_DIRECTORY)) {
openDir(currFile);
} else {
//switch To Next
doDismiss();
}
}
}).start();
} else {
forwardCommand(c, d);
}
}
示例2: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if(c.equals(CMD_SAVE)) {
UserValidator validator = new UserValidator(view);
int status = validator.validateNewUser();
if(status == UserValidator.OK) {
User u = validator.constructUser();
//Don't add the user to the RMS yet, that's for the receiver.
transitions.userCreated(u);
} else {
validator.handleInvalidUser(status, this);
}
} else if(c.equals(CMD_CANCEL)) {
transitions.cancel();
}
}
示例3: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if(c.equals(FeedbackReportScreen.SEND_REPORT)) {
String message = screen.getString();
String url = PropertyManager._().getSingularProperty(FeedbackReportProperties.FEEDBACK_REPORT_SERVER);
String id = PropertyManager._().getSingularProperty("DeviceID");
throw new RuntimeException("Feedback Reporting: needs to be converted to new transport layer");
// //TODO: For now, only http is supported, so we hack this to switch to that.
// int httpmethod = (new HttpTransportMethod()).getId();
// TransportManager._().setCurrentTransportMethod(httpmethod);
//
// TransportMessage tmessage = new TransportMessage(new ByteArrayPayload(message.getBytes(), "Feedback Message",IDataPayload.PAYLOAD_TYPE_TEXT), new HttpTransportDestination(url),id,-1);
// TransportManager._().send(tmessage, httpmethod);
//
// //TODO: Feedback!
//
// done();
} else if (c.equals(FeedbackReportScreen.CANCEL)) {
done();
}
}
示例4: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command com, Displayable d) {
if (d instanceof Alert) {
J2MEDisplay.setView(this.manager);
}
if (d == manager) {
String action = manager.getString(manager.getSelectedIndex());
if (action.equals(CLEAR_LOGS)) {
clearLogs();
}
if (action.equals(VIEW_LOGS)) {
viewLogs();
}
if (action.equals(SEND_LOGS)) {
sendLogs();
}
if (com.equals(EXIT)) {
done();
}
} else if (d == viewer) {
J2MEDisplay.setView(this.manager);
}
}
示例5: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command command, Displayable d) {
if (command.equals(cameraCommand)) {
processCamera();
} else if (command.equals(browseCommand)) {
processBrowser();
} else if (command.equals(cancelCommand)) {
processCancel();
} else if (command.equals(changeSniffDirectoryCommand)) {
processChangeDirectory();
} else if (command.equals(returnCommand)) {
processReturn();
} else {
ChoiceGroup curr = mainList;
//int index = curr.getSelectedIndex();
int index = curr.getFocusedIndex();
if (index != -1) {
final String currFile = curr.getString(index);
if (command.equals(viewCommand)) {
processView(currFile);
} else if (command.equals(deleteCommand)) {
processDelete(currFile);
}
}
}
}
示例6: commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void commandAction(Command cmd, Displayable disp) {
if (cmd.equals(RadioPlayerView.CMD_START)) {
int selIdx = stationChoice.getSelectedIndex();
RadioPlayerView playerView = new RadioPlayerView(selIdx, midlet);
RadioPlayer player = new RadioPlayer(selIdx);
Display.getDisplay(midlet).setCurrent(playerView);
playerView.setPlayer(player);
player.startPlayer();
} else if (cmd.equals(RadioPlayerView.CMD_EXIT)) {
this.midlet.destroyApp(false);
this.midlet.notifyDestroyed();
} else if (cmd.equals(ABOUT)) {
Display.getDisplay(midlet).setCurrent(new AboutForm(midlet));
} else if (cmd.equals(HELP)) {
Display.getDisplay(midlet).setCurrent(new HelpForm(midlet));
}
}
示例7: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if(c.equals(List.SELECT_COMMAND)) {
controller.chooseSessionItem(view.getSelectedIndex());
controller.next();
}
else if(c.equals(BACK)) {
transitions.exitMenuTransition();
}
}
示例8: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if(c.equals(CommCareOTACredentialEntry.DOWNLOAD)) {
if(userExists(entry.getUsername()) && !isSync) {
entry.sendMessage(Localization.get("restore.user.exists"));
return;
}
this.authenticator = new HttpAuthenticator(CommCareUtil.wrapCredentialProvider(new DefaultHttpCredentialProvider(entry.getUsername(), entry.getPassword())), false);
entry.setInteractive(false);
fView.setInteractive(false);
mRestorer.initialize(this, transitions, restoreURI, authenticator, isSync, noPartial, syncToken, logSubmitURI);
if(isSync) {
isUpdatingUser = true;
}
//tryDownload(getClientMessage());
} else if(d == entry && c.equals(CommCareOTACredentialEntry.CANCEL)) {
transitions.cancel();
} else if(c.equals(view.FINISHED)) {
markDoneAndExit();
}
else if(c.equals(CommCareOTAFailView.DOWNLOAD)){
entry.setInteractive(false);
fView.setInteractive(false);
mRestorer.initialize(this, transitions, restoreURI, authenticator, isSync, noPartial, syncToken, logSubmitURI);
}
else if(c.equals(CommCareOTAFailView.CANCEL)){
transitions.cancel();
}
}
示例9: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if(c.equals(CMD_SAVE)) {
UserValidator validator = new UserValidator(view);
int status = validator.validateUserEdit();
if(status == UserValidator.OK) {
User u = validator.constructUser();
//Save to RMS?
transitions.userEdited(u);
} else {
validator.handleInvalidUser(status, this);
}
} else if(c.equals(CMD_CANCEL)) {
transitions.cancel();
}
}
示例10: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command cmd, Displayable display) {
if (cmd.equals(this.mBackCommand)) {
goBack();
}
else if (cmd.equals(this.mCaptureCommand)) {
doCapture();
//doCaptureLoop();
}
}
示例11: _commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void _commandAction(Command cmd, Displayable d) {
if (d == this) {
if (cmd == okCmd) {
psa.entityChosen(recordID);
} else if (cmd == backCmd) {
psa.showList();
} else {
for(int i = 0 ; i < phoneCallouts.length ; ++i) {
if(cmd.equals(phoneCallouts[i])) {
psa.attemptCallout(data[i]);
}
}
}
}
}
示例12: commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void commandAction(Command cmd, Displayable displayable) {
if(cmd.equals(this.cmdCancel)) {
Display.getDisplay(midlet).setCurrent(this.map);
} else if(cmd.equals(this.cmdSubmitBug)) {
OpenStreetBugs.submitBug(location, txtProblem.getString(), txtUsername.getString());
Display.getDisplay(midlet).setCurrent(this.map);
}
}
示例13: commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void commandAction(Command cmd, Displayable disp) {
try {
if (cmd.equals(cmdBack)) {
if (this.player != null) {
this.player.stopPlayer();
}
Display.getDisplay(midlet).setCurrent(new StationsList(midlet));
}
} catch (Exception ex) {
exceptionOccurred(ex);
}
}
示例14: commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
public void commandAction(Command command, Displayable displayable) {
if(command.equals(this.cmdBack)) {
Display.getDisplay(midlet).setCurrent(midlet.getMap());
}
}
示例15: commandAction
import javax.microedition.lcdui.Command; //导入方法依赖的package包/类
/**
* Called when action should be handled
*/
public void commandAction(Command command, Displayable displayable) {
if (command.equals(this.cmdExit)) {
midlet.destroyApp(false);
midlet.notifyDestroyed();
} else if (command.equals(this.cmdBugreport)) {
Display.getDisplay(midlet).setCurrent(
new ReportMapErrorDialog(midlet, this.scrollPos, this));
} else if (command.equals(this.cmdShowBugs)) {
float[] rpp = Math2.radPerPixel(zoom);
float xmin = (scrollPos.getX() - rpp[0] * getWidth() / 2);
float xmax = (scrollPos.getX() + rpp[0] * getWidth() / 2);
float ymin = (scrollPos.getY() - rpp[1] * getHeight() / 2);
float ymax = (scrollPos.getY() + rpp[1] * getHeight() / 2);
OpenStreetBugs.getBugs(xmin, xmax, ymin, ymax, this);
} else if (command.equals(this.cmdSwitchStreetMap)) {
removeCommand(this.cmdSwitchStreetMap);
addCommand(this.cmdSwitchCycleMap);
mapSource = TileCache.SOURCE_OPENSTREETMAP;
repaint();
midlet.getConfig().set(Config.LASTMAPTYPE, "osm");
} else if (command.equals(this.cmdSwitchCycleMap)) {
removeCommand(this.cmdSwitchCycleMap);
addCommand(this.cmdSwitchStreetMap);
mapSource = TileCache.SOURCE_OPENCYCLEMAP;
repaint();
midlet.getConfig().set(Config.LASTMAPTYPE, "ocm");
} else if (command.equals(this.cmdFollow)) {
removeCommand(cmdFollow);
addCommand(cmdUnfollow);
follow = true;
} else if (command.equals(this.cmdUnfollow)) {
removeCommand(cmdUnfollow);
addCommand(cmdFollow);
follow = false;
} else if (command.equals(this.cmdAddBTGPS)) {
// Start BLUElet to discover Bluetooth devices
bluelet = new BLUElet(midlet, this);
bluelet.startApp();
bluelet.startInquiry(DiscoveryAgent.GIAC, new UUID[] { new UUID(0x1101) });
Display.getDisplay(midlet).setCurrent(bluelet.getUI());
} else if (command.equals(BLUElet.BACK)) {
bluelet.destroyApp(false);
Display.getDisplay(midlet).setCurrent(midlet.getMap());
} else if (command.equals(BLUElet.COMPLETED)) {
// RemoteDevice btDev = bluelet.getSelectedDevice();
ServiceRecord serviceRecord = bluelet.getFirstDiscoveredService();
if (serviceRecord != null) {
String url = serviceRecord.getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
false);
this.gpsPos.attachBTGPS(url);
} else {
midlet.getDebugDialog().addMessage("Note", "No BT ServiceRecord found!");
}
Display.getDisplay(midlet).setCurrent(midlet.getMap());
} else if (command.equals(BLUElet.SELECTED)) {
} else if (command.equals(this.cmdDebug)) {
midlet.getDebugDialog().show();
} else if (command.equals(this.cmdAbout)) {
Display.getDisplay(midlet).setCurrent(new AboutForm(midlet));
} else if (command.equals(cmdHelp)) {
Display.getDisplay(midlet).setCurrent(new HelpForm(midlet));
}
}