Esempio n. 1
0
 public void enableLoadSource() {
   loadButton.setEnabled(true);
   loadSourceMenuItem.setEnabled(true);
 }
Esempio n. 2
0
  // initializes the internal component of the translator
  protected void jbInit() {
    this.getContentPane().setLayout(new GridBagLayout());

    loadButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            loadButton_actionPerformed(e);
          }
        });
    loadButton.setMaximumSize(new Dimension(39, 39));
    loadButton.setMinimumSize(new Dimension(39, 39));
    loadButton.setPreferredSize(new Dimension(39, 39));
    loadButton.setSize(new Dimension(39, 39));
    loadButton.setToolTipText("Load Source File");
    loadButton.setIcon(loadIcon);

    saveButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            saveButton_actionPerformed(e);
          }
        });
    saveButton.setMaximumSize(new Dimension(39, 39));
    saveButton.setMinimumSize(new Dimension(39, 39));
    saveButton.setPreferredSize(new Dimension(39, 39));
    saveButton.setSize(new Dimension(39, 39));
    saveButton.setToolTipText("Save Destination File");
    saveButton.setIcon(saveIcon);

    singleStepButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            singleStepButton_actionPerformed(e);
          }
        });
    singleStepButton.setMaximumSize(new Dimension(39, 39));
    singleStepButton.setMinimumSize(new Dimension(39, 39));
    singleStepButton.setPreferredSize(new Dimension(39, 39));
    singleStepButton.setSize(new Dimension(39, 39));
    singleStepButton.setToolTipText("Single Step");
    singleStepButton.setIcon(singleStepIcon);

    ffwdButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            ffwdButton_actionPerformed(e);
          }
        });
    ffwdButton.setMaximumSize(new Dimension(39, 39));
    ffwdButton.setMinimumSize(new Dimension(39, 39));
    ffwdButton.setPreferredSize(new Dimension(39, 39));
    ffwdButton.setSize(new Dimension(39, 39));
    ffwdButton.setToolTipText("Fast Forward");
    ffwdButton.setIcon(ffwdIcon);

    rewindButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            rewindButton_actionPerformed(e);
          }
        });
    rewindButton.setMaximumSize(new Dimension(39, 39));
    rewindButton.setMinimumSize(new Dimension(39, 39));
    rewindButton.setPreferredSize(new Dimension(39, 39));
    rewindButton.setSize(new Dimension(39, 39));
    rewindButton.setToolTipText("Rewind");
    rewindButton.setIcon(rewindIcon);

    stopButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            stopButton_actionPerformed(e);
          }
        });
    stopButton.setMaximumSize(new Dimension(39, 39));
    stopButton.setMinimumSize(new Dimension(39, 39));
    stopButton.setPreferredSize(new Dimension(39, 39));
    stopButton.setSize(new Dimension(39, 39));
    stopButton.setToolTipText("Stop");
    stopButton.setIcon(stopIcon);

    fullTranslationButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fullTranslationButton_actionPerformed(e);
          }
        });
    fullTranslationButton.setMaximumSize(new Dimension(39, 39));
    fullTranslationButton.setMinimumSize(new Dimension(39, 39));
    fullTranslationButton.setPreferredSize(new Dimension(39, 39));
    fullTranslationButton.setSize(new Dimension(39, 39));
    fullTranslationButton.setToolTipText("Fast Translation");
    fullTranslationButton.setIcon(fullTranslationIcon);

    messageLbl.setFont(Utilities.statusLineFont);
    messageLbl.setLineWrap(true);
    messageLbl.setEditable(false);
    messageLbl.setCursor(null);
    messageLbl.setOpaque(false);
    messageLbl.setFocusable(false);
    messageLblPane.setBorder(BorderFactory.createLoweredBevelBorder());
    // messageLblPane.setBounds(new Rectangle(0, 672, TRANSLATOR_WIDTH - 8, 20));
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.gridwidth = 3;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 2;
    this.getContentPane().add(messageLblPane, c);

    // arrowLabel.setBounds(new Rectangle(290, 324, 88, 71));
    arrowLabel.setIcon(arrowIcon);

    // source.setVisibleRows(31);
    // destination.setVisibleRows(31);
    // source.setBounds(new Rectangle(35,100,source.getWidth(),source.getHeight()));
    // destination.setBounds(new Rectangle(375,100,destination.getWidth(),destination.getHeight()));

    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 1;
    this.getContentPane().add(source, c);

    c.fill = GridBagConstraints.NONE;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 0;
    c.weighty = 0;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 1;
    c.gridy = 1;
    this.getContentPane().add(arrowLabel, c);

    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 2;
    c.gridy = 1;
    this.getContentPane().add(destination, c);

    // Adding the tool bar to this container.
    toolBar.setFloatable(false);
    toolBar.setLocation(0, 0);
    toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
    toolBar.setBorder(BorderFactory.createEtchedBorder());
    arrangeToolBar();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.gridwidth = 3;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 0;
    this.getContentPane().add(toolBar, c);
    toolBar.revalidate();
    toolBar.repaint();
    repaint();

    // Creating the menu bar
    arrangeMenu();
    setJMenuBar(menuBar);

    // initializing the window size and visibility
    setDefaultCloseOperation(3);
    setSize(new Dimension(TRANSLATOR_WIDTH, TRANSLATOR_HEIGHT));
    setVisible(true);
  }
Esempio n. 3
0
 public void enableFullCompilation() {
   fullTranslationButton.setEnabled(true);
   fullTranslationMenuItem.setEnabled(true);
 }
Esempio n. 4
0
 public void disableLoadSource() {
   loadButton.setEnabled(false);
   loadSourceMenuItem.setEnabled(false);
 }
Esempio n. 5
0
 public void enableSave() {
   saveButton.setEnabled(true);
   saveDestMenuItem.setEnabled(true);
 }
Esempio n. 6
0
 public void disableFullCompilation() {
   fullTranslationButton.setEnabled(false);
   fullTranslationMenuItem.setEnabled(false);
 }
Esempio n. 7
0
 public void enableRewind() {
   rewindButton.setEnabled(true);
   rewindMenuItem.setEnabled(true);
 }
Esempio n. 8
0
 public void disableSave() {
   saveButton.setEnabled(false);
   saveDestMenuItem.setEnabled(false);
 }
Esempio n. 9
0
 public void enableSingleStep() {
   singleStepButton.setEnabled(true);
   singleStepMenuItem.setEnabled(true);
 }
Esempio n. 10
0
 public void disableRewind() {
   rewindButton.setEnabled(false);
   rewindMenuItem.setEnabled(false);
 }
Esempio n. 11
0
 public void disableSingleStep() {
   singleStepButton.setEnabled(false);
   singleStepMenuItem.setEnabled(false);
 }
Esempio n. 12
0
 public void enableFastForward() {
   ffwdButton.setEnabled(true);
   ffwdMenuItem.setEnabled(true);
 }
Esempio n. 13
0
 public void disableFastForward() {
   ffwdButton.setEnabled(false);
   ffwdMenuItem.setEnabled(false);
 }
Esempio n. 14
0
 public void enableStop() {
   stopButton.setEnabled(true);
   stopMenuItem.setEnabled(true);
 }
Esempio n. 15
0
 public void disableStop() {
   stopButton.setEnabled(false);
   stopMenuItem.setEnabled(false);
 }