コード例 #1
0
  public JMenu buildSketchMenu() {
    JMenuItem runItem =
        Toolkit.newJMenuItem(AndroidToolbar.getTitle(AndroidToolbar.RUN, false), 'R');
    runItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            handleRunDevice();
          }
        });

    JMenuItem presentItem =
        Toolkit.newJMenuItemShift(AndroidToolbar.getTitle(AndroidToolbar.RUN, true), 'R');
    presentItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            handleRunEmulator();
          }
        });

    JMenuItem stopItem = new JMenuItem(AndroidToolbar.getTitle(AndroidToolbar.STOP, false));
    stopItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            handleStop();
          }
        });
    return buildSketchMenu(new JMenuItem[] {runItem, presentItem, stopItem});
  }
コード例 #2
0
  public JMenu buildFileMenu() {
    String exportPkgTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, false);
    JMenuItem exportPackage = Toolkit.newJMenuItem(exportPkgTitle, 'E');
    exportPackage.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            handleExportPackage();
          }
        });

    String exportProjectTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, true);
    JMenuItem exportProject = Toolkit.newJMenuItemShift(exportProjectTitle, 'E');
    exportProject.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            handleExportProject();
          }
        });

    return buildFileMenu(new JMenuItem[] {exportPackage, exportProject});
  }