当前位置: 首页>>代码示例>>Java>>正文


Java Command.BACK属性代码示例

本文整理汇总了Java中javax.microedition.lcdui.Command.BACK属性的典型用法代码示例。如果您正苦于以下问题:Java Command.BACK属性的具体用法?Java Command.BACK怎么用?Java Command.BACK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.microedition.lcdui.Command的用法示例。


在下文中一共展示了Command.BACK属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCommands

public void setCommands(Vector v) {
    if(currentCommands != null) {
        for(int iter = 0 ; iter < currentCommands.length ; iter++) {
            removeCommand(currentCommands[iter]);
        }
    }
    setCommandListener(this);
    currentCommands = new Command[v.size()];
    com.codename1.ui.Command backCommand = null;
    if(Display.getInstance().getCurrent() != null) {
        backCommand = Display.getInstance().getCurrent().getBackCommand();
    }
    for(int iter = 0 ; iter < currentCommands.length ; iter++) {
        com.codename1.ui.Command current = (com.codename1.ui.Command)v.elementAt(iter);
        if(current == backCommand) {
            currentCommands[iter] = new MIDP2CodenameOneCommand(current, Command.BACK, iter + 1);
        } else {
            if(iter == 0) {
                currentCommands[iter] = new MIDP2CodenameOneCommand(current, Command.OK, iter + 1);
            } else {
                currentCommands[iter] = new MIDP2CodenameOneCommand(current, iter + 1);
            }
        }
        addCommand(currentCommands[iter]);
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:26,代码来源:GameCanvasImplementation.java

示例2: showCamera

private void showCamera() {
    try {
        mPlayer = Manager.createPlayer("capture://video");
        mPlayer.realize();

        mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");

        //    Command mExitCommand = new Command("Exit", Command.EXIT, 0);
        //    Command mCameraCommand = new Command("Camera", Command.SCREEN, 0);
        mBackCommand = new Command("Back", Command.BACK, 0);
        mCaptureCommand = new Command("Capture", Command.SCREEN, 0);

        Canvas canvas = new CameraCanvas(null, mVideoControl);
        canvas.addCommand(mBackCommand);
        canvas.addCommand(mCaptureCommand);
        canvas.setCommandListener(this);

        J2MEDisplay.setView(canvas);
        mPlayer.start();
    } catch (IOException ioe) {
        handleException(ioe);
    } catch (MediaException me) {
        handleException(me);
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:25,代码来源:ImageCaptureState.java

示例3: EntitySelectDetailPopup

public EntitySelectDetailPopup (EntitySelectController<E> psa, Entity<E> entity, EntitySet<E> set) {
    //#style entityDetailScreen
    super(Localization.get("entity.detail.title", new String[] {entity.entityType()}));

    this.psa = psa;

    recordID = entity.getRecordID();
    headers = entity.getHeaders(true);
    data = entity.getLongFields(set.get(recordID));
    forms = entity.getLongForms(false);

    phoneCallouts = new Command[data.length];

    okCmd = new Command(Localization.get("command.ok"), Command.OK, 1);
    backCmd = new Command(Localization.get("command.back"), Command.BACK, 1);
    addCommand(okCmd);
    addCommand(backCmd);
    setCommandListener(this);

    loadData();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:21,代码来源:EntitySelectDetailPopup.java

示例4: ConnectGui

/**
       *
       * Constructor
       */
public ConnectGui(){
	super("Nodes");

	// The ChoiceGroup
	nodes = new ChoiceGroup("Choose the node(s) to connect to",Choice.MULTIPLE);

          	nodeAddressList = new Hashtable();

	// The Commands
	back = new Command("Back",Command.BACK,1);
	displayLog = new Command("Display log",Command.ITEM,4);
	connect = new Command("Connect",Command.ITEM,0);
	exit = new Command("Exit", Command.EXIT,0);

	addCommand(back);
          addCommand(connect);
	addCommand(displayLog);
	addCommand(exit);
	// Adds the ChoiceGroup
	append(nodes);

}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:26,代码来源:Peer2Messenger.java

示例5: Midlet

public Midlet() {
        form = new Form("Hello World");
        form.append("Hello Micro World");
        quit = new Command("Quit", Command.EXIT, 1);
        Command lala = new Command("Flee", Command.BACK, 2);
//        form.addCommand(lala);
        form.addCommand(quit);
        form.addCommand(lala);
        form.setCommandListener(new CommandListener() {

            public void commandAction(Command c, Displayable d) {
                try {
                    if (c == quit) {
                        destroyApp(true);
                        notifyDestroyed();
                    }
                } catch (Exception e) {

                }
            }
        });
    }
 
开发者ID:angelbirth,项目名称:gameloft,代码行数:22,代码来源:Midlet.java

示例6: setupCommands

private void setupCommands(){
	save = new Command("Save", Command.BACK, 1);
	cancel = new Command("Cancel", Command.CANCEL, 1);
	this.addCommand(save);
	this.addCommand(cancel);
	this.setCommandListener(this);
}
 
开发者ID:NotesTeam,项目名称:TaskBook-J2ME,代码行数:7,代码来源:AddNoteForm.java

示例7: onPrepareOptionsMenu

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
	MIDletAccess ma = MIDletBridge.getMIDletAccess();
	if (ma == null) {
		return false;
	}
	final DisplayAccess da = ma.getDisplayAccess();
	if (da == null) {
		return false;
	}
	AndroidDisplayableUI ui = (AndroidDisplayableUI) da.getDisplayableUI(da.getCurrent());
	if (ui == null) {
		return false;
	}		
	
	menu.clear();	
	boolean result = false;
	List<AndroidCommandUI> commands = ui.getCommandsUI();
	for (int i = 0; i < commands.size(); i++) {
		result = true;
		AndroidCommandUI cmd = commands.get(i);
		if (cmd.getCommand().getCommandType() != Command.BACK && cmd.getCommand().getCommandType() != Command.EXIT) {
			SubMenu item = menu.addSubMenu(Menu.NONE, i + Menu.FIRST, Menu.NONE, cmd.getCommand().getLabel());
			item.setIcon(cmd.getDrawable());
		}
	}

	return result;
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:29,代码来源:MicroEmulator.java

示例8: initCommands

private void initCommands()
{
    recordCommand = new Command("Record", Command.SCREEN, 0);
    form.addCommand(recordCommand);
    playCommand = new Command("Play", Command.SCREEN, 1);
    stopCommand = new Command("Stop", Command.SCREEN, 0); //Do not add immediately
    backCommand = new Command("Back", Command.BACK, 0);
    form.addCommand(backCommand);
    finishCommand = new Command("Finish", Command.OK, 0);
    saveCommand = new Command("Save", Command.SCREEN, 0);
    eraseCommand = new Command("Erase", Command.SCREEN, 0);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:12,代码来源:AudioCaptureState.java

示例9: start

public void start () {
    messages = new Vector<String>();

    //#style networkTestForm
    interactiveView = new FramedForm(Localization.get("network.test.title"));
    exit = new Command(Localization.get("polish.command.ok"), Command.BACK, 0);
    back = new Command(Localization.get("polish.command.back"), Command.BACK, 0);
    details = new Command(Localization.get("network.test.details"), Command.SCREEN, 2);
    interactiveView.setCommandListener(this);
    interactiveView.addCommand(exit);

    //#style networkTestImage
    imageView = new ImageItem(null, null, ImageItem.LAYOUT_CENTER | ImageItem.LAYOUT_VCENTER, "");

    interactiveMessage = new StringItem(null, "");

    interactiveView.append(Graphics.TOP, imageView);
    interactiveView.append(interactiveMessage);

    J2MEDisplay.setView(interactiveView);

    final GPRSTestState parent = this;
    new HandledThread () {
        public void _run () {
            networkTest(parent);
        }
    }.start();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:28,代码来源:GPRSTestState.java

示例10: start

public void start () {
    view = new Form("Permissions test");
    exit = new Command("OK", Command.BACK, 0);
    view.setCommandListener(this);
    view.addCommand(exit);
    J2MEDisplay.setView(view);

    final PermissionsTestState parent = this;
    new HandledThread () {
        public void _run () {
            permissionsTest(parent);
        }
    }.start();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:14,代码来源:PermissionsTestState.java

示例11: showReplyView

/**
 * Show the 'Reply' view (a full-screen TextBox).
 */
private void showReplyView() {
    final Command cancelCommand = new Command("Cancel", Command.BACK, 0);
    final Command sendCommand = new Command("Send", Command.OK, 0);

    replyView = new TextBox("Reply", null, 2000, TextField.ANY);
    replyView.addCommand(cancelCommand);
    replyView.addCommand(sendCommand);

    replyView.setCommandListener(new CommandListener() {
        public void commandAction(Command command, Displayable d) {
            // Cancel and return back to previous view
            if (command == cancelCommand) {
                setDisplay(self);
            }
            // Submit command
            else if (command == sendCommand) {
                String modhash = session.getModhash();
                replyOperation = new CommentPostOperation(
                    item.getName(),
                    replyView.getString(),
                    modhash,
                    (PostCommentListener) self
                );
                replyOperation.start();
            }
        }
    });
    setDisplay(replyView);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:32,代码来源:CommentDetailsView.java

示例12: setupCommands

private void setupCommands() {
	back = new Command("Back", Command.BACK, 0);
	this.addCommand(back);
	this.setCommandListener(this);
}
 
开发者ID:NotesTeam,项目名称:TaskBook-J2ME,代码行数:5,代码来源:ShowNoteForm.java


注:本文中的javax.microedition.lcdui.Command.BACK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。