예제 #1
0
 public void enableLoadSource() {
   loadButton.setEnabled(true);
   loadSourceMenuItem.setEnabled(true);
 }
예제 #2
0
  // arranges the menu bar
  protected void arrangeMenu() {
    // Build the first menu.
    fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);
    menuBar.add(fileMenu);

    runMenu = new JMenu("Run");
    runMenu.setMnemonic(KeyEvent.VK_R);
    menuBar.add(runMenu);

    helpMenu = new JMenu("Help");
    helpMenu.setMnemonic(KeyEvent.VK_H);
    menuBar.add(helpMenu);

    loadSourceMenuItem = new JMenuItem("Load Source file", KeyEvent.VK_O);
    loadSourceMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            loadSourceMenuItem_actionPerformed(e);
          }
        });
    fileMenu.add(loadSourceMenuItem);

    saveDestMenuItem = new JMenuItem("Save Destination file", KeyEvent.VK_S);
    saveDestMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            saveDestMenuItem_actionPerformed(e);
          }
        });
    fileMenu.add(saveDestMenuItem);

    fileMenu.addSeparator();

    exitMenuItem = new JMenuItem("Exit", KeyEvent.VK_X);
    exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
    exitMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            exitMenuItem_actionPerformed(e);
          }
        });
    fileMenu.add(exitMenuItem);

    singleStepMenuItem = new JMenuItem("Single Step", KeyEvent.VK_S);
    singleStepMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            singleStepMenuItem_actionPerformed(e);
          }
        });
    runMenu.add(singleStepMenuItem);

    ffwdMenuItem = new JMenuItem("Fast Forward", KeyEvent.VK_F);
    ffwdMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            ffwdMenuItem_actionPerformed(e);
          }
        });
    runMenu.add(ffwdMenuItem);

    stopMenuItem = new JMenuItem("Stop", KeyEvent.VK_T);
    stopMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            stopMenuItem_actionPerformed(e);
          }
        });
    runMenu.add(stopMenuItem);

    rewindMenuItem = new JMenuItem("Rewind", KeyEvent.VK_R);
    rewindMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            rewindMenuItem_actionPerformed(e);
          }
        });
    runMenu.add(rewindMenuItem);
    runMenu.addSeparator();

    fullTranslationMenuItem = new JMenuItem("Fast Translation", KeyEvent.VK_U);
    fullTranslationMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fullTranslationMenuItem_actionPerformed(e);
          }
        });
    runMenu.add(fullTranslationMenuItem);

    usageMenuItem = new JMenuItem("Usage", KeyEvent.VK_U);
    usageMenuItem.setAccelerator(KeyStroke.getKeyStroke("F1"));
    usageMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            usageMenuItem_actionPerformed(e);
          }
        });
    helpMenu.add(usageMenuItem);

    aboutMenuItem = new JMenuItem("About...", KeyEvent.VK_A);
    aboutMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            aboutMenuItem_actionPerformed(e);
          }
        });
    helpMenu.add(aboutMenuItem);
  }
예제 #3
0
 public void enableFullCompilation() {
   fullTranslationButton.setEnabled(true);
   fullTranslationMenuItem.setEnabled(true);
 }
예제 #4
0
 public void disableLoadSource() {
   loadButton.setEnabled(false);
   loadSourceMenuItem.setEnabled(false);
 }
예제 #5
0
 public void enableSave() {
   saveButton.setEnabled(true);
   saveDestMenuItem.setEnabled(true);
 }
예제 #6
0
 public void disableFullCompilation() {
   fullTranslationButton.setEnabled(false);
   fullTranslationMenuItem.setEnabled(false);
 }
예제 #7
0
 public void enableRewind() {
   rewindButton.setEnabled(true);
   rewindMenuItem.setEnabled(true);
 }
예제 #8
0
 public void disableSave() {
   saveButton.setEnabled(false);
   saveDestMenuItem.setEnabled(false);
 }
예제 #9
0
 public void enableSingleStep() {
   singleStepButton.setEnabled(true);
   singleStepMenuItem.setEnabled(true);
 }
예제 #10
0
 public void disableRewind() {
   rewindButton.setEnabled(false);
   rewindMenuItem.setEnabled(false);
 }
예제 #11
0
 public void disableSingleStep() {
   singleStepButton.setEnabled(false);
   singleStepMenuItem.setEnabled(false);
 }
예제 #12
0
 public void enableFastForward() {
   ffwdButton.setEnabled(true);
   ffwdMenuItem.setEnabled(true);
 }
예제 #13
0
 public void disableFastForward() {
   ffwdButton.setEnabled(false);
   ffwdMenuItem.setEnabled(false);
 }
예제 #14
0
 public void enableStop() {
   stopButton.setEnabled(true);
   stopMenuItem.setEnabled(true);
 }
예제 #15
0
 public void disableStop() {
   stopButton.setEnabled(false);
   stopMenuItem.setEnabled(false);
 }