本文整理汇总了Java中javax.microedition.lcdui.Displayable类的典型用法代码示例。如果您正苦于以下问题:Java Displayable类的具体用法?Java Displayable怎么用?Java Displayable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Displayable类属于javax.microedition.lcdui包,在下文中一共展示了Displayable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: choiceform
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public int choiceform (String sTitle, String sOk, String sCancel, String[] vElements)
{
javax.microedition.lcdui.List list = new javax.microedition.lcdui.List(sTitle,
javax.microedition.lcdui.List.EXCLUSIVE, vElements, null);
Displayable prev = jcc2.application.Main.singleton.display.getCurrent();
CMD_OK = new javax.microedition.lcdui.Command (sOk, javax.microedition.lcdui.Command.OK, 1);
CMD_CANCEL = new javax.microedition.lcdui.Command (sCancel, javax.microedition.lcdui.Command.CANCEL, 1);
list.addCommand(CMD_OK);
list.addCommand(CMD_CANCEL);
list.setCommandListener(this);
bContinue = false;
vArg = new int[1];
((int[])vArg)[0] = javax.microedition.lcdui.List.EXCLUSIVE;
jcc2.application.Main.singleton.display.setCurrent(list);
while (!bContinue)
Thread.yield();
jcc2.application.Main.singleton.display.setCurrent(prev);
return ((int[])vArg)[0];
}
示例2: selectform
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public int selectform (String sTitle, String sOk, String sCancel, String[] vElements)
{
javax.microedition.lcdui.List list = new javax.microedition.lcdui.List(sTitle,
javax.microedition.lcdui.List.IMPLICIT, vElements, null);
Displayable prev = jcc2.application.Main.singleton.display.getCurrent();
CMD_OK = new javax.microedition.lcdui.Command (sOk, javax.microedition.lcdui.Command.OK, 1);
CMD_CANCEL = new javax.microedition.lcdui.Command (sCancel, javax.microedition.lcdui.Command.CANCEL, 1);
list.addCommand(CMD_OK);
list.addCommand(CMD_CANCEL);
list.setCommandListener(this);
bContinue = false;
vArg = new int[1];
((int[])vArg)[0] = javax.microedition.lcdui.List.IMPLICIT;
jcc2.application.Main.singleton.display.setCurrent(list);
while (!bContinue)
Thread.yield();
jcc2.application.Main.singleton.display.setCurrent(prev);
return ((int[])vArg)[0];
}
示例3: mulchoiceform
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public byte[] mulchoiceform (String sTitle, String sOk, String sCancel, String[] vElements)
{
javax.microedition.lcdui.List list = new javax.microedition.lcdui.List(sTitle,
javax.microedition.lcdui.List.MULTIPLE, vElements, null);
Displayable prev = jcc2.application.Main.singleton.display.getCurrent();
CMD_OK = new javax.microedition.lcdui.Command (sOk, javax.microedition.lcdui.Command.OK, 1);
CMD_CANCEL = new javax.microedition.lcdui.Command (sCancel, javax.microedition.lcdui.Command.CANCEL, 1);
list.addCommand(CMD_OK);
list.addCommand(CMD_CANCEL);
list.setCommandListener(this);
bContinue = false;
vArg = new int[1];
((int[])vArg)[0] = javax.microedition.lcdui.List.MULTIPLE;
jcc2.application.Main.singleton.display.setCurrent(list);
while (!bContinue)
Thread.yield();
jcc2.application.Main.singleton.display.setCurrent(prev);
return (byte[])vArg;
}
示例4: editform
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public String editform (String sTitle, String sOk, String sCancel, String sText, int maxlen, int mode)
{
javax.microedition.lcdui.TextBox textbox = new javax.microedition.lcdui.TextBox (sTitle, sText, maxlen, mode);
Displayable prev = jcc2.application.Main.singleton.display.getCurrent();
CMD_OK = new javax.microedition.lcdui.Command (sOk, javax.microedition.lcdui.Command.OK, 1);
CMD_CANCEL = new javax.microedition.lcdui.Command (sCancel, javax.microedition.lcdui.Command.CANCEL, 1);
textbox.addCommand(CMD_OK);
textbox.addCommand(CMD_CANCEL);
textbox.setCommandListener(this);
bContinue = false;
jcc2.application.Main.singleton.display.setCurrent(textbox);
while (!bContinue)
Thread.yield();
jcc2.application.Main.singleton.display.setCurrent(prev);
return (String)vArg;
}
示例5: messagebox
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public int messagebox (String sTitle, String sOk, String sCancel, String sText)
{
javax.microedition.lcdui.Alert alert = new javax.microedition.lcdui.Alert (sTitle, sText,
null, javax.microedition.lcdui.AlertType.INFO);
alert.setTimeout(javax.microedition.lcdui.Alert.FOREVER);
CMD_OK = new javax.microedition.lcdui.Command (sOk, javax.microedition.lcdui.Command.OK, 1);
CMD_CANCEL = new javax.microedition.lcdui.Command (sCancel, javax.microedition.lcdui.Command.CANCEL, 1);
alert.addCommand(CMD_OK);
alert.addCommand(CMD_CANCEL);
alert.setCommandListener(this);
Displayable prev = jcc2.application.Main.singleton.display.getCurrent();
jcc2.application.Main.singleton.display.setCurrent(alert);
bContinue = false;
while (!bContinue)
Thread.yield();
jcc2.application.Main.singleton.display.setCurrent(prev);
return ((int[])vArg)[0];
}
示例6: setCurrent
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
/**
* @inheritDoc
*/
private void setCurrent(Displayable d) {
if (display == null) {
throw new IllegalStateException("First call Display.setDisplay(javax.microedition.lcdui.Display d) method");
}
if(!minimized) {
if (d instanceof Canvas) {
if(!disableFullScreen) {
((Canvas) d).setFullScreenMode(!com.codename1.ui.Display.getInstance().isNativeCommands());
}
}
display.setCurrent(d);
}
}
示例7: _commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void _commandAction(Command command, Displayable arg1) {
if (command == cancelCommand) {
cleanUp();
forwardCommand(command, arg1);
} else if (command == setCallingScreenDataCommand) {
IAnswerData data = this.getAcquiredData();
if (data != null) {
questionScreen.setAcquiredData(data);
_commandAction(cancelCommand, this);
}
} else {
handleCustomCommand(command, arg1);
}
}
示例8: commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的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));
}
}
示例9: _commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void _commandAction(Command comm, Displayable disp) {
if (comm == locView.cancelCommand) {
transitions.captureCancelled();
} else if (comm == locView.okCommand) {
if (locService.getStatus() == LocationCaptureService.FIX_OBTAINED)
{
interrupted=true;
transitions.captured(myLoc);
}
else
transitions.captureCancelled();
} else if (comm == locView.retryCommand) {
captureThread = new HandledThread(this, "CaptureThread");
captureThread.start();
}
}
示例10: commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void commandAction(Command command, Displayable displayable) {
if (command == commentCommand) {
openDetailsView(null);
}
else if (command == backCommand) {
abortLoadingComments();
backListener.backCommanded();
}
else if (command == refreshCommand) {
refresh();
}
else if (command == aboutCommand) {
showAboutView();
}
else if (command == loginCommand) {
showLoginView();
}
else if (command == logoutCommand) {
session.setLoggedOut();
setupCommands();
}
}
示例11: _commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void _commandAction(Command c, Displayable d) {
if (d == view) {
if (c == List.SELECT_COMMAND) {
int index = view.getSelectedIndex();
if (index == this.formInfo.size())//The same as download image
{
transitions.downloadForms();
}
else if (index != -1)
{
transitions.formSelected(((Integer)formInfo.keyAt(index)).intValue());
}
} else if (c == view.CMD_EXIT) {
transitions.exit();
} else if (c == view.CMD_VIEW_SAVED) {
transitions.viewSaved();
} else if (c == view.CMD_DOWNLOAD_FORMS) {
transitions.downloadForms();
} else if (c == view.CMD_SETTINGS) {
transitions.settings();
}
}
}
示例12: commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void commandAction(Command cmd, Displayable disp) {
//#debug info
System.out.println("commandAction with cmd=" + cmd.getLabel() + ", screen=" + disp );
if (cmd == this.backCommand) {
display.setCurrent(mainScreen);
} else if (cmd == this.exitCommand) {
//#debug info
System.out.println("Exit application");
this.notifyDestroyed();
} else if (cmd == this.aboutCommand) {
String param = this.getAppProperty("Xfolite-Version");
Alert alert = new Alert(
Locale.get("main.label.about"),
Locale.get("main.msg.about", param),
null,
AlertType.INFO);
// Looks like an error but builds
this.display.setCurrent(alert, mainScreen);
}
}
示例13: ShowNoteForm
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public ShowNoteForm(Displayable backDisplay, Note note) {
super("Note informations");
display = MainMidlet.getDisplay();
this.backDisplay = backDisplay;
this.note = note;
setupCommands();
setupFields();
inflateView();
}
示例14: commandAction
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public void commandAction(Command c, Displayable d) {
if (c == List.SELECT_COMMAND)
showNoteDetails();
else if (c == addNote)
addNewNote();
else if (c == sortByCategory)
sortListByCategory();
else if (c == sortByPriority)
sortListByPriority();
else if (c == sortByTime)
sortListByTime();
else if (c == exit)
exitApplication();
}
示例15: AddNoteForm
import javax.microedition.lcdui.Displayable; //导入依赖的package包/类
public AddNoteForm(ListUpdateListener callback, Displayable backDisplay) {
super("Add note");
this.backDisplay = backDisplay;
this.callback = callback;
display = MainMidlet.getDisplay();
setupCommands();
setupFields();
}