Example usage for java.awt.event KeyEvent VK_S

List of usage examples for java.awt.event KeyEvent VK_S

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_S.

Prototype

int VK_S

To view the source code for java.awt.event KeyEvent VK_S.

Click Source Link

Document

Constant for the "S" key.

Usage

From source file:edmondskarp.Gui.EdmondsKarpGui.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//w w w .  j ava2s.c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jPopupMenu1 = new javax.swing.JPopupMenu();
    jMenuItem2 = new javax.swing.JMenuItem();
    jMenuItem3 = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JPopupMenu.Separator();
    jMenuItem6 = new javax.swing.JMenuItem();
    jPopupMenu2 = new javax.swing.JPopupMenu();
    jMenuItem7 = new javax.swing.JMenuItem();
    jMenuItem8 = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JPopupMenu.Separator();
    jMenuItem9 = new javax.swing.JMenuItem();
    jDialog1 = new javax.swing.JDialog();
    jPanel2 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    jDialog2 = new javax.swing.JDialog();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jPanel3 = new javax.swing.JPanel();
    jTextField1 = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jSliderPosText = new javax.swing.JSlider();
    jButtonSetDefCapacity = new javax.swing.JButton();
    jRadioButtonRandomCap = new javax.swing.JRadioButton();
    jRadioButtonDefaultCap = new javax.swing.JRadioButton();
    jPanel4 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jButtonDefaultColor = new javax.swing.JButton();
    jButtonAttraversatoColor = new javax.swing.JButton();
    jButtonSaturoColor = new javax.swing.JButton();
    jLabel11 = new javax.swing.JLabel();
    jButtonSelezionatoColor = new javax.swing.JButton();
    jPanel5 = new javax.swing.JPanel();
    jLabel8 = new javax.swing.JLabel();
    jComboBoxDimCircle = new javax.swing.JComboBox<>();
    jLabel9 = new javax.swing.JLabel();
    jComboBoxDimText = new javax.swing.JComboBox<>();
    StrokeCirclejSlider = new javax.swing.JSlider();
    StrokeArrowjSlider = new javax.swing.JSlider();
    jLabel10 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    pencilButton = new javax.swing.JToggleButton();
    rubberButton = new javax.swing.JToggleButton();
    playButton = new javax.swing.JToggleButton();
    backButton = new javax.swing.JButton();
    forwardButton = new javax.swing.JButton();
    stopButton = new javax.swing.JButton();
    runButton = new javax.swing.JButton();
    jComboBox1 = new javax.swing.JComboBox<>();
    dragButton = new javax.swing.JToggleButton();
    undoButton = new javax.swing.JButton();
    redoButton = new javax.swing.JButton();
    residualButton = new javax.swing.JToggleButton();
    jLabelMin = new javax.swing.JLabel();
    jLabelMaxFlow = new javax.swing.JLabel();
    myPanel = new MyPanel(this);
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem5 = new javax.swing.JMenuItem();
    jMenuItem1 = new javax.swing.JMenuItem();
    jMenuItem4 = new javax.swing.JMenuItem();
    jMenuItemExit = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    jMenuItemExample = new javax.swing.JMenuItem();
    jMenuItem10 = new javax.swing.JMenuItem();
    jMenu3 = new javax.swing.JMenu();
    jMenuItemAbout = new javax.swing.JMenuItem();

    jPopupMenu1.setLightWeightPopupEnabled(false);
    jPopupMenu1.setMaximumSize(new java.awt.Dimension(97, 54));
    jPopupMenu1.setMinimumSize(new java.awt.Dimension(97, 54));

    jMenuItem2.setText("Imposta sorgente");
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setSourceActionPerformed(evt);
        }
    });
    jPopupMenu1.add(jMenuItem2);

    jMenuItem3.setText("Imposta pozzo");
    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setSinkActionPerformed(evt);
        }
    });
    jPopupMenu1.add(jMenuItem3);
    jPopupMenu1.add(jSeparator1);

    jMenuItem6.setText("Elimina nodo");
    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteNodeActionPerformed(evt);
        }
    });
    jPopupMenu1.add(jMenuItem6);

    jPopupMenu1.getAccessibleContext().setAccessibleDescription("");

    jMenuItem7.setText("Imposta capacit");
    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setCapacityActionPerformed(evt);
        }
    });
    jPopupMenu2.add(jMenuItem7);

    jMenuItem8.setText("Imposta flusso");
    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setFlowActionPerformed(evt);
        }
    });
    jPopupMenu2.add(jMenuItem8);
    jPopupMenu2.add(jSeparator2);

    jMenuItem9.setText("Elimina arco");
    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteEdgeActionPerformed(evt);
        }
    });
    jPopupMenu2.add(jMenuItem9);

    jDialog1.setTitle("Inserisci il valore");

    jLabel1.setText("imposta capacit");

    jTextField2.setNextFocusableComponent(jButton2);

    jButton2.setText("Ok");
    jButton2.setFocusable(false);
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 139,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 79,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18).addComponent(jButton2,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 70,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(31, Short.MAX_VALUE)));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton2).addContainerGap(24, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel2Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(25, 25, 25)))));

    javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
    jDialog1.getContentPane().setLayout(jDialog1Layout);
    jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel2,
                    javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel2,
                    javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.PREFERRED_SIZE));

    jDialog2.setMinimumSize(new java.awt.Dimension(341, 266));

    jTabbedPane2.setMinimumSize(new java.awt.Dimension(349, 304));

    jPanel3.setMinimumSize(new java.awt.Dimension(341, 266));

    jTextField1.setEnabled(false);

    jLabel2.setText("Capacit default");

    jLabel7.setText("Posizione testo");

    jSliderPosText.setMaximum(150);
    jSliderPosText.setMinimum(30);
    jSliderPosText.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jSliderPosTextStateChanged(evt);
        }
    });

    jButtonSetDefCapacity.setText("Set");
    jButtonSetDefCapacity.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonSetDefCapacityActionPerformed(evt);
        }
    });

    jRadioButtonRandomCap.setSelected(true);
    jRadioButtonRandomCap.setText("Capcit random");
    jRadioButtonRandomCap.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonRandomCapActionPerformed(evt);
        }
    });

    jRadioButtonDefaultCap.setText("Capacit default");
    jRadioButtonDefaultCap.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonDefaultCapActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup().addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 62,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18).addComponent(jButtonSetDefCapacity,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 71,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel7)
                    .addComponent(jSliderPosText, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButtonRandomCap).addComponent(jRadioButtonDefaultCap))
                    .addContainerGap(111, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addGap(24, 24, 24)
                    .addComponent(jRadioButtonRandomCap).addGap(18, 18, 18).addComponent(jRadioButtonDefaultCap)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField1).addComponent(jButtonSetDefCapacity))
                    .addGap(18, 18, 18).addComponent(jLabel7)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSliderPosText, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(68, Short.MAX_VALUE)));

    jTabbedPane2.addTab("Generale", jPanel3);

    jPanel4.setMinimumSize(new java.awt.Dimension(341, 266));

    jLabel3.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel3.setText("Arco");

    jLabel4.setText("default");

    jLabel5.setText("attraversato");

    jLabel6.setText("saturo");

    jButtonDefaultColor.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            defaultColorActionPerformed(evt);
        }
    });

    jButtonAttraversatoColor.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            attraversatoColorActionPerformed(evt);
        }
    });

    jButtonSaturoColor.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saturoColorActionPerformed(evt);
        }
    });

    jLabel11.setText("selezionato");

    jButtonSelezionatoColor.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selezionatoColorActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout
                    .createSequentialGroup().addContainerGap().addGroup(jPanel4Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                                    jLabel3)
                            .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.LEADING))
                                    .addGap(23, 23, 23)
                                    .addGroup(jPanel4Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButtonSaturoColor,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButtonAttraversatoColor,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButtonSelezionatoColor,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButtonDefaultColor,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(221, Short.MAX_VALUE)));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButtonDefaultColor, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButtonAttraversatoColor,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel4Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButtonSaturoColor, javax.swing.GroupLayout.DEFAULT_SIZE, 24,
                                    Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButtonSelezionatoColor, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            24, Short.MAX_VALUE)
                                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(128, 128, 128)));

    jTabbedPane2.addTab("Colori", jPanel4);

    jPanel5.setMinimumSize(new java.awt.Dimension(341, 266));

    jLabel8.setText("Circonferenza nodi");

    jComboBoxDimCircle.setModel(new javax.swing.DefaultComboBoxModel<>(
            new String[] { "25", "30", "35", "40", "45", "50", "55", "60", "65" }));
    jComboBoxDimCircle.setToolTipText("");
    jComboBoxDimCircle.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBoxDimCircleActionPerformed(evt);
        }
    });

    jLabel9.setText("Testo");

    jComboBoxDimText.setModel(new javax.swing.DefaultComboBoxModel<>(
            new String[] { "10", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30" }));
    jComboBoxDimText.setSelectedIndex(3);
    jComboBoxDimText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            DimTextActionPerformed(evt);
        }
    });

    StrokeCirclejSlider.setMaximum(60);
    StrokeCirclejSlider.setMinimum(1);
    StrokeCirclejSlider.setPaintLabels(true);
    StrokeCirclejSlider.setPaintTicks(true);
    StrokeCirclejSlider.setValue(10);
    StrokeCirclejSlider.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            StrokeCirclejSliderStateChanged(evt);
        }
    });

    StrokeArrowjSlider.setMaximum(60);
    StrokeArrowjSlider.setMinimum(1);
    StrokeArrowjSlider.setPaintLabels(true);
    StrokeArrowjSlider.setPaintTicks(true);
    StrokeArrowjSlider.setValue(10);
    StrokeArrowjSlider.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            StrokeArrowjSliderStateChanged(evt);
        }
    });

    jLabel10.setText("Linea Nodi");

    jLabel12.setText("Linea Archi");

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addGroup(jPanel5Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup().addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel5Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jComboBoxDimText, javax.swing.GroupLayout.Alignment.LEADING,
                                            0, 64, Short.MAX_VALUE)
                                    .addComponent(jComboBoxDimCircle, javax.swing.GroupLayout.Alignment.LEADING,
                                            0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGap(154, 154, 154))
                    .addGroup(jPanel5Layout.createSequentialGroup().addGroup(jPanel5Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 41,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel5Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout
                                            .createSequentialGroup().addComponent(jLabel10)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(StrokeCirclejSlider,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                            jPanel5Layout.createSequentialGroup().addComponent(jLabel12)
                                                    .addGap(18, 18, 18).addComponent(StrokeArrowjSlider,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboBoxDimCircle))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboBoxDimText))
                    .addGap(30, 30, 30)
                    .addGroup(
                            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(StrokeCirclejSlider, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(27, 27, 27)
                    .addGroup(
                            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(StrokeArrowjSlider, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 54,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(27, 27, 27)));

    jTabbedPane2.addTab("Dimensioni", jPanel5);

    javax.swing.GroupLayout jDialog2Layout = new javax.swing.GroupLayout(jDialog2.getContentPane());
    jDialog2.getContentPane().setLayout(jDialog2Layout);
    jDialog2Layout
            .setHorizontalGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jDialog2Layout.setVerticalGroup(jDialog2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane2,
                    javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE));

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    setBackground(new java.awt.Color(255, 255, 255));
    setPreferredSize(new java.awt.Dimension(1100, 650));

    jPanel1.setBackground(new java.awt.Color(169, 169, 169));
    jPanel1.setPreferredSize(new java.awt.Dimension(824, 50));

    pencilButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/draw.png"))); // NOI18N
    pencilButton.setSelected(true);
    pencilButton.setToolTipText("draw");
    pencilButton.setFocusable(false);
    pencilButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    pencilButton.setMaximumSize(new java.awt.Dimension(30, 30));
    pencilButton.setMinimumSize(new java.awt.Dimension(24, 24));
    pencilButton.setName(""); // NOI18N
    pencilButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pencilButtonActionPerformed(evt);
        }
    });

    rubberButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/remove.png"))); // NOI18N
    rubberButton.setToolTipText("erase");
    rubberButton.setFocusable(false);
    rubberButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    rubberButton.setMaximumSize(new java.awt.Dimension(30, 30));
    rubberButton.setMinimumSize(new java.awt.Dimension(24, 24));
    rubberButton.setName(""); // NOI18N
    rubberButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            rubberButtonActionPerformed(evt);
        }
    });

    playButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/play.png"))); // NOI18N
    playButton.setToolTipText("play");
    playButton.setFocusable(false);
    playButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    playButton.setMaximumSize(new java.awt.Dimension(30, 30));
    playButton.setMinimumSize(new java.awt.Dimension(24, 24));
    playButton.setName(""); // NOI18N
    playButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            playButtonActionPerformed(evt);
        }
    });

    backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/back 1.png"))); // NOI18N
    backButton.setFocusable(false);
    backButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backButtonActionPerformed(evt);
        }
    });

    forwardButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/forward 1.png"))); // NOI18N
    forwardButton.setFocusable(false);
    forwardButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            forwardButtonActionPerformed(evt);
        }
    });

    stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/square.png"))); // NOI18N
    stopButton.setToolTipText("stop");
    stopButton.setFocusable(false);
    stopButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stopButtonActionPerformed(evt);
        }
    });

    runButton.setText("Run");
    runButton.setToolTipText("stop");
    runButton.setFocusable(false);
    runButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            runButtonActionPerformed(evt);
        }
    });

    jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "BFS", "DFS" }));
    jComboBox1.setFocusable(false);
    jComboBox1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBox1ActionPerformed(evt);
        }
    });

    dragButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/drag.png"))); // NOI18N
    dragButton.setToolTipText("erase");
    dragButton.setFocusable(false);
    dragButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    dragButton.setMaximumSize(new java.awt.Dimension(30, 30));
    dragButton.setMinimumSize(new java.awt.Dimension(24, 24));
    dragButton.setName(""); // NOI18N
    dragButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            dragButtonActionPerformed(evt);
        }
    });

    undoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/undo.png"))); // NOI18N
    undoButton.setToolTipText("undo");
    undoButton.setFocusable(false);
    undoButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            undoButtonActionPerformed(evt);
        }
    });

    redoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edmondskarp/Gui/icon/redo.png"))); // NOI18N
    redoButton.setToolTipText("redo");
    redoButton.setFocusable(false);
    redoButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            redoButtonActionPerformed(evt);
        }
    });

    residualButton.setText("Residuo");
    residualButton.setToolTipText("grafo residuo");
    residualButton.setFocusable(false);
    residualButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    residualButton.setMaximumSize(new java.awt.Dimension(30, 30));
    residualButton.setMinimumSize(new java.awt.Dimension(24, 24));
    residualButton.setName(""); // NOI18N
    residualButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            residualButtonActionPerformed(evt);
        }
    });

    jLabelMin.setFont(new java.awt.Font("Ubuntu", 1, 24)); // NOI18N
    jLabelMin.setText("Min = 0");

    jLabelMaxFlow.setFont(new java.awt.Font("Ubuntu", 1, 24)); // NOI18N
    jLabelMaxFlow.setText("Flow = 0");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addComponent(pencilButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(rubberButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(dragButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(undoButton, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(redoButton, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(24, 24, 24)
                    .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(5, 5, 5)
                    .addComponent(playButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(5, 5, 5)
                    .addComponent(forwardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(runButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 103,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(26, 26, 26)
                    .addComponent(residualButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(40, 40, 40).addComponent(jLabelMin).addGap(35, 35, 35).addComponent(jLabelMaxFlow)
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(stopButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(forwardButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(backButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(playButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(rubberButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(pencilButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(runButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(dragButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(undoButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(redoButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(residualButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelMaxFlow, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabelMin, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(670, 670, 670)));

    runButton.getAccessibleContext().setAccessibleDescription("run");

    getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);

    myPanel.setBackground(new java.awt.Color(255, 255, 255));
    myPanel.setMaximumSize(new java.awt.Dimension(1920, 1080));
    myPanel.setPreferredSize(new java.awt.Dimension(800, 600));
    myPanel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            myPanelMouseReleased(evt);
        }

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            myPanelMouseClicked(evt);
        }
    });
    myPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseDragged(java.awt.event.MouseEvent evt) {
            myPanelMouseDragged(evt);
        }
    });

    javax.swing.GroupLayout myPanelLayout = new javax.swing.GroupLayout(myPanel);
    myPanel.setLayout(myPanelLayout);
    myPanelLayout.setHorizontalGroup(myPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 973, Short.MAX_VALUE));
    myPanelLayout.setVerticalGroup(myPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 668, Short.MAX_VALUE));

    getContentPane().add(myPanel, java.awt.BorderLayout.CENTER);

    jMenu1.setText("File");
    jMenu1.setPreferredSize(new java.awt.Dimension(50, 21));

    jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem5.setText("Nuovo");
    jMenuItem5.setPreferredSize(new java.awt.Dimension(110, 25));
    jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem5);

    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText("Apri");
    jMenuItem1.setPreferredSize(new java.awt.Dimension(110, 25));
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            OpenActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem1);

    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem4.setText("Salva");
    jMenuItem4.setPreferredSize(new java.awt.Dimension(110, 25));
    jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SaveActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem4);

    jMenuItemExit.setText("Exit");
    jMenuItemExit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItemExitActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItemExit);

    jMenuBar1.add(jMenu1);

    jMenu2.setText("Modifica");
    jMenu2.setMaximumSize(new java.awt.Dimension(70, 32767));
    jMenu2.setPreferredSize(new java.awt.Dimension(90, 21));

    jMenuItemExample.setText("Carica esempio");
    jMenuItemExample.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItemExampleActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItemExample);

    jMenuItem10.setText("Preference");
    jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            preferenceActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem10);

    jMenuBar1.add(jMenu2);

    jMenu3.setText("help");
    jMenu3.setPreferredSize(new java.awt.Dimension(40, 21));

    jMenuItemAbout.setText("About");
    jMenuItemAbout.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItemAboutActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItemAbout);

    jMenuBar1.add(jMenu3);

    setJMenuBar(jMenuBar1);

    pack();
}

From source file:org.domainmath.gui.MainFrame.java

/** This method is called from within the constructor to
 * initialize the form.//from  ww  w  .j  av  a2  s  . c o  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    jToolBar1 = new javax.swing.JToolBar();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jSeparator4 = new javax.swing.JToolBar.Separator();
    connectButton = new javax.swing.JButton();
    disconnectButton = new javax.swing.JButton();
    jSeparator9 = new javax.swing.JToolBar.Separator();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jSeparator15 = new javax.swing.JToolBar.Separator();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    jButton8 = new javax.swing.JButton();
    jSeparator13 = new javax.swing.JToolBar.Separator();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    dirComboBox = new javax.swing.JComboBox();
    folderUpButton = new javax.swing.JButton();
    browseButton = new javax.swing.JButton();
    addButton = new javax.swing.JButton();
    jMenuBar1 = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    newFileItem = new javax.swing.JMenuItem();
    openItem = new javax.swing.JMenuItem();
    jSeparator17 = new javax.swing.JPopupMenu.Separator();
    saveFileItem = new javax.swing.JMenuItem();
    saveAsItem = new javax.swing.JMenuItem();
    savePlotItem = new javax.swing.JMenuItem();
    saveAllItem = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JPopupMenu.Separator();
    printFileItem = new javax.swing.JMenuItem();
    printItem = new javax.swing.JMenuItem();
    jSeparator19 = new javax.swing.JPopupMenu.Separator();
    preferencesItem = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JPopupMenu.Separator();
    connectItem = new javax.swing.JMenuItem();
    disconnectItem = new javax.swing.JMenuItem();
    jSeparator3 = new javax.swing.JPopupMenu.Separator();
    exitItem = new javax.swing.JMenuItem();
    editMenu = new javax.swing.JMenu();
    undoItem = new javax.swing.JMenuItem();
    redoItem = new javax.swing.JMenuItem();
    jSeparator20 = new javax.swing.JPopupMenu.Separator();
    cutItem = new javax.swing.JMenuItem();
    copyItem = new javax.swing.JMenuItem();
    pasteItem = new javax.swing.JMenuItem();
    jSeparator21 = new javax.swing.JPopupMenu.Separator();
    deleteItem = new javax.swing.JMenuItem();
    selectAllItem = new javax.swing.JMenuItem();
    jSeparator22 = new javax.swing.JPopupMenu.Separator();
    jMenuItem2 = new javax.swing.JMenuItem();
    jMenuItem3 = new javax.swing.JMenuItem();
    jSeparator23 = new javax.swing.JPopupMenu.Separator();
    jMenuItem4 = new javax.swing.JMenuItem();
    jMenuItem5 = new javax.swing.JMenuItem();
    jSeparator24 = new javax.swing.JPopupMenu.Separator();
    jMenuItem6 = new javax.swing.JMenuItem();
    jMenuItem1 = new javax.swing.JMenuItem();
    jSeparator11 = new javax.swing.JPopupMenu.Separator();
    clearOutWindowItem = new javax.swing.JMenuItem();
    jMenu3 = new javax.swing.JMenu();
    consoleItem = new javax.swing.JMenuItem();
    historyItem = new javax.swing.JMenuItem();
    filesItem = new javax.swing.JMenuItem();
    workspaceItem = new javax.swing.JMenuItem();
    codeEditorItem = new javax.swing.JMenuItem();
    pathsItem = new javax.swing.JMenuItem();
    pkgsItem = new javax.swing.JMenuItem();
    arrayEditItem = new javax.swing.JMenuItem();
    jMenuItem7 = new javax.swing.JMenuItem();
    jMenu1 = new javax.swing.JMenu();
    findItem = new javax.swing.JMenuItem();
    replaceItem = new javax.swing.JMenuItem();
    gotoItem = new javax.swing.JMenuItem();
    jSeparator25 = new javax.swing.JPopupMenu.Separator();
    googleItem = new javax.swing.JMenuItem();
    wikiItem = new javax.swing.JMenuItem();
    pkgMenu = new javax.swing.JMenu();
    debugMenu = new javax.swing.JMenu();
    runScriptItem = new javax.swing.JMenuItem();
    runScriptCItem = new javax.swing.JMenuItem();
    jMenuItem8 = new javax.swing.JMenuItem();
    jSeparator8 = new javax.swing.JPopupMenu.Separator();
    debugScriptMenuItem = new javax.swing.JMenuItem();
    testScriptMenuItem = new javax.swing.JMenuItem();
    toggleBreakpointItem = new javax.swing.JMenuItem();
    removeToggleBreakpointItem = new javax.swing.JMenuItem();
    clearAllBreakpointsItem = new javax.swing.JMenuItem();
    jSeparator10 = new javax.swing.JPopupMenu.Separator();
    stepItem = new javax.swing.JMenuItem();
    stepInItem = new javax.swing.JMenuItem();
    stepOutItem = new javax.swing.JMenuItem();
    continueItem = new javax.swing.JMenuItem();
    jSeparator5 = new javax.swing.JPopupMenu.Separator();
    finishDebugItem = new javax.swing.JMenuItem();
    toolsMenu = new javax.swing.JMenu();
    fltkplotItem = new javax.swing.JMenuItem();
    octaveCmdItem = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    previousWindowItem = new javax.swing.JMenuItem();
    nextWindowItem = new javax.swing.JMenuItem();
    jSeparator29 = new javax.swing.JPopupMenu.Separator();
    closeItem = new javax.swing.JMenuItem();
    closeAllItem = new javax.swing.JMenuItem();
    jSeparator18 = new javax.swing.JPopupMenu.Separator();
    windowsItem = new javax.swing.JMenuItem();
    helpMenu = new javax.swing.JMenu();
    forumItem = new javax.swing.JMenuItem();
    octaveInfoItem = new javax.swing.JMenuItem();
    jSeparator12 = new javax.swing.JPopupMenu.Separator();
    quickHelpItem = new javax.swing.JMenuItem();
    jMenuItem9 = new javax.swing.JMenuItem();
    docPkgItem = new javax.swing.JMenuItem();
    referenceMenu = new javax.swing.JMenu();
    referenceItem = new javax.swing.JMenuItem();
    jSeparator6 = new javax.swing.JPopupMenu.Separator();
    checkForUpdatesMenuItem = new javax.swing.JMenuItem();
    onlineHelpItem = new javax.swing.JMenuItem();
    faqItem = new javax.swing.JMenuItem();
    jSeparator14 = new javax.swing.JPopupMenu.Separator();
    reportBugItem = new javax.swing.JMenuItem();
    feedBackItem = new javax.swing.JMenuItem();
    jSeparator7 = new javax.swing.JPopupMenu.Separator();
    AboutItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    java.util.ResourceBundle bundle = java.util.ResourceBundle
            .getBundle("org/domainmath/gui/resources/DomainMath_en"); // NOI18N
    setTitle(bundle.getString("DomainMath.title")); // NOI18N
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }

        public void windowOpened(java.awt.event.WindowEvent evt) {
            formWindowOpened(evt);
        }
    });

    jToolBar1.setRollover(true);
    jToolBar1.setName("Standard"); // NOI18N

    jButton1.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-new.png"))); // NOI18N
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton1);

    jButton2.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N
    jButton2.setFocusable(false);
    jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton2);

    jButton3.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-save-all.png"))); // NOI18N
    jButton3.setFocusable(false);
    jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton3);
    jToolBar1.add(jSeparator4);

    connectButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/connect.png"))); // NOI18N
    connectButton.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("connectItem.mnemonic").charAt(0));
    connectButton.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N
    connectButton.setFocusable(false);
    connectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    connectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    connectButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            connectButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(connectButton);

    disconnectButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/disconnect.png"))); // NOI18N
    disconnectButton
            .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
                    .getString("disconnectItem.mnemonic").charAt(0));
    disconnectButton.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N
    disconnectButton.setFocusable(false);
    disconnectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    disconnectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    disconnectButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            disconnectButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(disconnectButton);
    jToolBar1.add(jSeparator9);

    jButton4.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-undo.png"))); // NOI18N
    jButton4.setFocusable(false);
    jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton4);

    jButton5.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-redo.png"))); // NOI18N
    jButton5.setFocusable(false);
    jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton5);
    jToolBar1.add(jSeparator15);

    jButton6.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-cut.png"))); // NOI18N
    jButton6.setFocusable(false);
    jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton6);

    jButton7.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-copy.png"))); // NOI18N
    jButton7.setFocusable(false);
    jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton7);

    jButton8.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-paste.png"))); // NOI18N
    jButton8.setFocusable(false);
    jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton8ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton8);
    jToolBar1.add(jSeparator13);

    jLabel1.setText("Current Directory:");

    dirComboBox.setEditable(true);
    dirComboBox.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            dirComboBoxItemStateChanged(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout
            .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(1, 1, 1).addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(dirComboBox, 0, 112, Short.MAX_VALUE).addGap(1, 1, 1)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(5, 5, 5).addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(dirComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3)));

    jToolBar1.add(jPanel1);

    folderUpButton.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/size22x22/go-up.png"))); // NOI18N
    folderUpButton.setToolTipText("Up");
    folderUpButton.setFocusable(false);
    folderUpButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    folderUpButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    folderUpButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            folderUpButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(folderUpButton);

    browseButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N
    browseButton.setToolTipText(bundle.getString("browseButton.title")); // NOI18N
    browseButton.setFocusable(false);
    browseButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    browseButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    browseButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            browseButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(browseButton);

    addButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-add.png"))); // NOI18N
    addButton.setToolTipText(bundle.getString("addButton.title")); // NOI18N
    addButton.setFocusable(false);
    addButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    addButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(addButton);

    getContentPane().add(jToolBar1, java.awt.BorderLayout.PAGE_START);

    fileMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("fileMenu.mnemonic").charAt(0));
    fileMenu.setText(bundle.getString("fileMenu.name")); // NOI18N

    newFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
            java.awt.event.InputEvent.CTRL_MASK));
    newFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-new.png"))); // NOI18N
    newFileItem.setText("New");
    newFileItem.setToolTipText(bundle.getString("newMenuItem.tooltip")); // NOI18N
    newFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(newFileItem);

    openItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    openItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-open.png"))); // NOI18N
    openItem.setText("Open...");
    openItem.setToolTipText("Open File");
    openItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            openItemActionPerformed(evt);
        }
    });
    fileMenu.add(openItem);
    fileMenu.add(jSeparator17);

    saveFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.CTRL_MASK));
    saveFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-save.png"))); // NOI18N
    saveFileItem.setText("Save ");
    saveFileItem.setToolTipText(bundle.getString("saveMenuItem.tooltp")); // NOI18N
    saveFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveFileItem);

    saveAsItem.setText("Save As...");
    saveAsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveAsItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveAsItem);

    savePlotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("savePlotItem.mnemonic").charAt(0));
    savePlotItem.setText(bundle.getString("savePlotItem.name")); // NOI18N
    savePlotItem.setToolTipText(bundle.getString("savePlotItem.tooltip")); // NOI18N
    savePlotItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            savePlotItemActionPerformed(evt);
        }
    });
    fileMenu.add(savePlotItem);

    saveAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    saveAllItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/document-save-all.png"))); // NOI18N
    saveAllItem.setText(bundle.getString("saveAllMenuItem.text")); // NOI18N
    saveAllItem.setToolTipText(bundle.getString("saveAllMenuItem.tooltip")); // NOI18N
    saveAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveAllItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveAllItem);
    fileMenu.add(jSeparator1);

    printFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
            java.awt.event.InputEvent.CTRL_MASK));
    printFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-print2.png"))); // NOI18N
    printFileItem.setText("Print");
    printFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            printFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(printFileItem);

    printItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    printItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("printItem.mnemonic").charAt(0));
    printItem.setText(bundle.getString("printItem.name")); // NOI18N
    printItem.setToolTipText(bundle.getString("printItem.tooltip")); // NOI18N
    printItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            printItemActionPerformed(evt);
        }
    });
    fileMenu.add(printItem);
    fileMenu.add(jSeparator19);

    preferencesItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/preferences.png"))); // NOI18N
    preferencesItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("preferecesItem.mnemonic").charAt(0));
    preferencesItem.setText(bundle.getString("preferencesItem.name")); // NOI18N
    preferencesItem.setToolTipText(bundle.getString("preferencesItem.tooltip")); // NOI18N
    preferencesItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            preferencesItemActionPerformed(evt);
        }
    });
    fileMenu.add(preferencesItem);
    fileMenu.add(jSeparator2);

    connectItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/connect.png"))); // NOI18N
    connectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("connectItem.mnemonic").charAt(0));
    connectItem.setText(bundle.getString("connectItem.name")); // NOI18N
    connectItem.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N
    connectItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            connectItemActionPerformed(evt);
        }
    });
    fileMenu.add(connectItem);

    disconnectItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/disconnect.png"))); // NOI18N
    disconnectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("disconnectItem.mnemonic").charAt(0));
    disconnectItem.setText(bundle.getString("disconnectItem.name")); // NOI18N
    disconnectItem.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N
    disconnectItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            disconnectItemActionPerformed(evt);
        }
    });
    fileMenu.add(disconnectItem);
    fileMenu.add(jSeparator3);

    exitItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("exitItem.mnemonic").charAt(0));
    exitItem.setText(bundle.getString("exitItem.name")); // NOI18N
    exitItem.setToolTipText(bundle.getString("exitItem.tooltip")); // NOI18N
    exitItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitItemActionPerformed(evt);
        }
    });
    fileMenu.add(exitItem);

    jMenuBar1.add(fileMenu);

    editMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("editMenu.mnemonic").charAt(0));
    editMenu.setText("Edit");

    undoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z,
            java.awt.event.InputEvent.CTRL_MASK));
    undoItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-undo.png"))); // NOI18N
    undoItem.setText("Undo");
    undoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            undoItemActionPerformed(evt);
        }
    });
    editMenu.add(undoItem);

    redoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y,
            java.awt.event.InputEvent.CTRL_MASK));
    redoItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-redo.png"))); // NOI18N
    redoItem.setText("Redo");
    redoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            redoItemActionPerformed(evt);
        }
    });
    editMenu.add(redoItem);
    editMenu.add(jSeparator20);

    cutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,
            java.awt.event.InputEvent.CTRL_MASK));
    cutItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-cut.png"))); // NOI18N
    cutItem.setText("Cut");
    cutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cutItemActionPerformed(evt);
        }
    });
    editMenu.add(cutItem);

    copyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            java.awt.event.InputEvent.CTRL_MASK));
    copyItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-copy.png"))); // NOI18N
    copyItem.setText("Copy");
    copyItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            copyItemActionPerformed(evt);
        }
    });
    editMenu.add(copyItem);

    pasteItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V,
            java.awt.event.InputEvent.CTRL_MASK));
    pasteItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-paste.png"))); // NOI18N
    pasteItem.setText("Paste");
    pasteItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pasteItemActionPerformed(evt);
        }
    });
    editMenu.add(pasteItem);
    editMenu.add(jSeparator21);

    deleteItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-delete.png"))); // NOI18N
    deleteItem.setText("Delete");
    deleteItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteItemActionPerformed(evt);
        }
    });
    editMenu.add(deleteItem);

    selectAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A,
            java.awt.event.InputEvent.CTRL_MASK));
    selectAllItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-select-all.png"))); // NOI18N
    selectAllItem.setText("Select All");
    selectAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectAllItemActionPerformed(evt);
        }
    });
    editMenu.add(selectAllItem);
    editMenu.add(jSeparator22);

    jMenuItem2.setAction(new RSyntaxTextAreaEditorKit.InsertTabAction());
    jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem2.setText("Increase Indent");
    editMenu.add(jMenuItem2);

    jMenuItem3.setAction(new RSyntaxTextAreaEditorKit.DecreaseIndentAction());
    jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB,
            java.awt.event.InputEvent.SHIFT_MASK));
    jMenuItem3.setText("Decrease Indent");
    editMenu.add(jMenuItem3);
    editMenu.add(jSeparator23);

    jMenuItem4.setAction(new RTextAreaEditorKit.UpperSelectionCaseAction());
    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem4.setText("Make Uppercase");
    editMenu.add(jMenuItem4);

    jMenuItem5.setAction(new RTextAreaEditorKit.LowerSelectionCaseAction());
    jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem5.setText("Make Lowercase");
    editMenu.add(jMenuItem5);
    editMenu.add(jSeparator24);

    jMenuItem6.setText("Clear All Marks...");
    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem6ActionPerformed(evt);
        }
    });
    editMenu.add(jMenuItem6);

    jMenuItem1.setAction(new RSyntaxTextAreaEditorKit.ToggleCommentAction());
    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SLASH,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText("Toggle Comment");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    editMenu.add(jMenuItem1);
    editMenu.add(jSeparator11);

    clearOutWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.CTRL_MASK));
    clearOutWindowItem
            .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
                    .getString("clearOutputWindowItem.mnemonic").charAt(0));
    clearOutWindowItem.setText(bundle.getString("clearOutputWindowItem.name")); // NOI18N
    clearOutWindowItem.setToolTipText(bundle.getString("clearOutputWindowItem.tooltip")); // NOI18N
    clearOutWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearOutWindowItemActionPerformed(evt);
        }
    });
    editMenu.add(clearOutWindowItem);

    jMenuBar1.add(editMenu);

    jMenu3.setText(bundle.getString("viewMenu.title")); // NOI18N

    consoleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_0,
            java.awt.event.InputEvent.CTRL_MASK));
    consoleItem.setText(bundle.getString("consoleItem.title")); // NOI18N
    consoleItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            consoleItemActionPerformed(evt);
        }
    });
    jMenu3.add(consoleItem);

    historyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1,
            java.awt.event.InputEvent.CTRL_MASK));
    historyItem.setText(bundle.getString("historyItem.title")); // NOI18N
    historyItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            historyItemActionPerformed(evt);
        }
    });
    jMenu3.add(historyItem);

    filesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2,
            java.awt.event.InputEvent.CTRL_MASK));
    filesItem.setText(bundle.getString("filesItem.title")); // NOI18N
    filesItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            filesItemActionPerformed(evt);
        }
    });
    jMenu3.add(filesItem);

    workspaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3,
            java.awt.event.InputEvent.CTRL_MASK));
    workspaceItem.setText(bundle.getString("worksaceItem.title")); // NOI18N
    workspaceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            workspaceItemActionPerformed(evt);
        }
    });
    jMenu3.add(workspaceItem);

    codeEditorItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_4,
            java.awt.event.InputEvent.CTRL_MASK));
    codeEditorItem.setText(bundle.getString("codeEditorItem.title")); // NOI18N
    codeEditorItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            codeEditorItemActionPerformed(evt);
        }
    });
    jMenu3.add(codeEditorItem);

    pathsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_5,
            java.awt.event.InputEvent.CTRL_MASK));
    pathsItem.setText(bundle.getString("setPathsItem.title")); // NOI18N
    pathsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pathsItemActionPerformed(evt);
        }
    });
    jMenu3.add(pathsItem);

    pkgsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_6,
            java.awt.event.InputEvent.CTRL_MASK));
    pkgsItem.setText(bundle.getString("pkgsItem.title")); // NOI18N
    pkgsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pkgsItemActionPerformed(evt);
        }
    });
    jMenu3.add(pkgsItem);

    arrayEditItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_7,
            java.awt.event.InputEvent.CTRL_MASK));
    arrayEditItem.setText(bundle.getString("arrayEidtorItem.title")); // NOI18N
    arrayEditItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            arrayEditItemActionPerformed(evt);
        }
    });
    jMenu3.add(arrayEditItem);

    jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_8,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem7.setText("Debugger Window");
    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem7ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem7);

    jMenuBar1.add(jMenu3);

    jMenu1.setMnemonic('S');
    jMenu1.setText("Search");

    findItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F,
            java.awt.event.InputEvent.CTRL_MASK));
    findItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-find.png"))); // NOI18N
    findItem.setMnemonic('F');
    findItem.setText("Find...");
    findItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            findItemActionPerformed(evt);
        }
    });
    jMenu1.add(findItem);

    replaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H,
            java.awt.event.InputEvent.CTRL_MASK));
    replaceItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/edit-find-replace.png"))); // NOI18N
    replaceItem.setText("Replace...");
    replaceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            replaceItemActionPerformed(evt);
        }
    });
    jMenu1.add(replaceItem);

    gotoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    gotoItem.setText("Go To...");
    gotoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            gotoItemActionPerformed(evt);
        }
    });
    jMenu1.add(gotoItem);
    jMenu1.add(jSeparator25);

    googleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G,
            java.awt.event.InputEvent.CTRL_MASK));
    googleItem.setText("Google Search");
    googleItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            googleItemActionPerformed(evt);
        }
    });
    jMenu1.add(googleItem);

    wikiItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    wikiItem.setText("Wikipedia Search");
    wikiItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            wikiItemActionPerformed(evt);
        }
    });
    jMenu1.add(wikiItem);

    jMenuBar1.add(jMenu1);

    pkgMenu.setText(bundle.getString("pkgMenu.name")); // NOI18N
    jMenuBar1.add(pkgMenu);

    debugMenu.setText("Debug");

    runScriptItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6, 0));
    runScriptItem
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/Run.png"))); // NOI18N
    runScriptItem.setText("Run Script");
    runScriptItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            runScriptItemActionPerformed(evt);
        }
    });
    debugMenu.add(runScriptItem);

    runScriptCItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6,
            java.awt.event.InputEvent.SHIFT_MASK));
    runScriptCItem.setText("Run Script from Console");
    runScriptCItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            runScriptCItemActionPerformed(evt);
        }
    });
    debugMenu.add(runScriptCItem);

    jMenuItem8.setText("Edit Run Configuration");
    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem8ActionPerformed(evt);
        }
    });
    debugMenu.add(jMenuItem8);
    debugMenu.add(jSeparator8);

    debugScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5,
            java.awt.event.InputEvent.CTRL_MASK));
    debugScriptMenuItem.setText("Debug Script");
    debugScriptMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            debugScriptMenuItemActionPerformed(evt);
        }
    });
    debugMenu.add(debugScriptMenuItem);

    testScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    testScriptMenuItem.setText("Test Script");
    testScriptMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            testScriptMenuItemActionPerformed(evt);
        }
    });
    debugMenu.add(testScriptMenuItem);

    toggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, 0));
    toggleBreakpointItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/resources/stop.png"))); // NOI18N
    toggleBreakpointItem.setText("Toggle Breakpoint");
    toggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            toggleBreakpointItemActionPerformed(evt);
        }
    });
    debugMenu.add(toggleBreakpointItem);

    removeToggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9,
            java.awt.event.InputEvent.SHIFT_MASK));
    removeToggleBreakpointItem.setText("Remove Toggle Breakpoint");
    removeToggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeToggleBreakpointItemActionPerformed(evt);
        }
    });
    debugMenu.add(removeToggleBreakpointItem);

    clearAllBreakpointsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    clearAllBreakpointsItem.setText("Clear All Breakpoints...");
    clearAllBreakpointsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearAllBreakpointsItemActionPerformed(evt);
        }
    });
    debugMenu.add(clearAllBreakpointsItem);
    debugMenu.add(jSeparator10);

    stepItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F10,
            java.awt.event.InputEvent.SHIFT_MASK));
    stepItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step.png"))); // NOI18N
    stepItem.setText("Step");
    stepItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepItem);

    stepInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11, 0));
    stepInItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-in.png"))); // NOI18N
    stepInItem.setText("Step in");
    stepInItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepInItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepInItem);

    stepOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11,
            java.awt.event.InputEvent.SHIFT_MASK));
    stepOutItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-out.png"))); // NOI18N
    stepOutItem.setText("Step out");
    stepOutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepOutItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepOutItem);

    continueItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F8, 0));
    continueItem.setText("Continue");
    continueItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            continueItemActionPerformed(evt);
        }
    });
    debugMenu.add(continueItem);
    debugMenu.add(jSeparator5);

    finishDebugItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5,
            java.awt.event.InputEvent.SHIFT_MASK));
    finishDebugItem
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/finish.png"))); // NOI18N
    finishDebugItem.setText("Finish Debugger Session");
    finishDebugItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            finishDebugItemActionPerformed(evt);
        }
    });
    debugMenu.add(finishDebugItem);

    jMenuBar1.add(debugMenu);

    toolsMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("ToolsMenu.mnemonic").charAt(0));
    toolsMenu.setText(bundle.getString("ToolsMenu.name")); // NOI18N

    fltkplotItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    fltkplotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("fltkPlotItem.mnemonic").charAt(0));
    fltkplotItem.setText(bundle.getString("fltkPlotItem.name")); // NOI18N
    fltkplotItem.setToolTipText(bundle.getString("fltkPlotItem.tooltip")); // NOI18N
    fltkplotItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fltkplotItemActionPerformed(evt);
        }
    });
    toolsMenu.add(fltkplotItem);

    octaveCmdItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("octaveCmdItem.mnemonic").charAt(0));
    octaveCmdItem.setText(bundle.getString("octaveCmdItem.name")); // NOI18N
    octaveCmdItem.setToolTipText(bundle.getString("octaveCmdItem.tooltip")); // NOI18N
    octaveCmdItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            octaveCmdItemActionPerformed(evt);
        }
    });
    toolsMenu.add(octaveCmdItem);

    jMenuBar1.add(toolsMenu);

    jMenu2.setText(bundle.getString("windowMenu.title")); // NOI18N

    previousWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_DOWN,
            java.awt.event.InputEvent.CTRL_MASK));
    previousWindowItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-previous.png"))); // NOI18N
    previousWindowItem.setText(bundle.getString("previousWindowItem.title")); // NOI18N
    previousWindowItem.setToolTipText(bundle.getString("previousWindowItem.tooltip")); // NOI18N
    previousWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            previousWindowItemActionPerformed(evt);
        }
    });
    jMenu2.add(previousWindowItem);

    nextWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_UP,
            java.awt.event.InputEvent.CTRL_MASK));
    nextWindowItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-next.png"))); // NOI18N
    nextWindowItem.setText(bundle.getString("nextWindowItem.title")); // NOI18N
    nextWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextWindowItemActionPerformed(evt);
        }
    });
    jMenu2.add(nextWindowItem);
    jMenu2.add(jSeparator29);

    closeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.ALT_MASK));
    closeItem.setText(bundle.getString("closeMenuItem.name")); // NOI18N
    closeItem.setToolTipText(bundle.getString("closeItem.tooltip")); // NOI18N
    closeItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            closeItemActionPerformed(evt);
        }
    });
    jMenu2.add(closeItem);

    closeAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    closeAllItem.setText(bundle.getString("closeAllItem.name")); // NOI18N
    closeAllItem.setToolTipText(bundle.getString("closeAllItem.tooltip")); // NOI18N
    closeAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            closeAllItemActionPerformed(evt);
        }
    });
    jMenu2.add(closeAllItem);
    jMenu2.add(jSeparator18);

    windowsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4,
            java.awt.event.InputEvent.SHIFT_MASK));
    windowsItem.setText(bundle.getString("windowsItem.title")); // NOI18N
    windowsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            windowsItemActionPerformed(evt);
        }
    });
    jMenu2.add(windowsItem);

    jMenuBar1.add(jMenu2);

    helpMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("helpMenu.mnemonic").charAt(0));
    helpMenu.setText(bundle.getString("helpMenu.name")); // NOI18N

    forumItem.setText("Forum");
    forumItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            forumItemActionPerformed(evt);
        }
    });
    helpMenu.add(forumItem);

    octaveInfoItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("octInfoItem.mnemonic").charAt(0));
    octaveInfoItem.setText(bundle.getString("octInfoItem.name")); // NOI18N
    octaveInfoItem.setToolTipText(bundle.getString("octInfoItem.tooltip")); // NOI18N
    octaveInfoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            octaveInfoItemActionPerformed(evt);
        }
    });
    helpMenu.add(octaveInfoItem);
    helpMenu.add(jSeparator12);

    quickHelpItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
    quickHelpItem.setText(bundle.getString("quickHelpItem.name")); // NOI18N
    quickHelpItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            quickHelpItemActionPerformed(evt);
        }
    });
    helpMenu.add(quickHelpItem);

    jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1,
            java.awt.event.InputEvent.SHIFT_MASK));
    jMenuItem9.setText("Package  Documentation");
    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem9ActionPerformed(evt);
        }
    });
    helpMenu.add(jMenuItem9);

    docPkgItem.setText("Package Online  Documentation");
    docPkgItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            docPkgItemActionPerformed(evt);
        }
    });
    helpMenu.add(docPkgItem);

    referenceMenu.setText(bundle.getString("referencesMenu.name")); // NOI18N
    helpMenu.add(referenceMenu);

    referenceItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("addReferencesItem.mnemonic").charAt(0));
    referenceItem.setText(bundle.getString("addReferencesItem.name")); // NOI18N
    referenceItem.setToolTipText(bundle.getString("addReferencesItem.tooltip")); // NOI18N
    referenceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            referenceItemActionPerformed(evt);
        }
    });
    helpMenu.add(referenceItem);
    helpMenu.add(jSeparator6);

    checkForUpdatesMenuItem.setText(bundle.getString("checkForUpdatesMenuItem.text")); // NOI18N
    checkForUpdatesMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkForUpdatesMenuItemActionPerformed(evt);
        }
    });
    helpMenu.add(checkForUpdatesMenuItem);

    onlineHelpItem.setText("Help and Support");
    onlineHelpItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            onlineHelpItemActionPerformed(evt);
        }
    });
    helpMenu.add(onlineHelpItem);

    faqItem.setText("Online FAQ");
    faqItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            faqItemActionPerformed(evt);
        }
    });
    helpMenu.add(faqItem);
    helpMenu.add(jSeparator14);

    reportBugItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("reportBugItem.mnemonic").charAt(0));
    reportBugItem.setText(bundle.getString("reportBugItem.name")); // NOI18N
    reportBugItem.setToolTipText(bundle.getString("reportBugItem.tooltip")); // NOI18N
    reportBugItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            reportBugItemActionPerformed(evt);
        }
    });
    helpMenu.add(reportBugItem);

    feedBackItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("yourFeedbackItem.mnemonic").charAt(0));
    feedBackItem.setText(bundle.getString("yourFeedbackItem.name")); // NOI18N
    feedBackItem.setToolTipText(bundle.getString("yourFeedbackItem.tooltip")); // NOI18N
    feedBackItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            feedBackItemActionPerformed(evt);
        }
    });
    helpMenu.add(feedBackItem);
    helpMenu.add(jSeparator7);

    AboutItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("aboutItem.mnemonic").charAt(0));
    AboutItem.setText(bundle.getString("aboutItem.name")); // NOI18N
    AboutItem.setToolTipText(bundle.getString("aboutItem.tooltip")); // NOI18N
    AboutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AboutItemActionPerformed(evt);
        }
    });
    helpMenu.add(AboutItem);

    jMenuBar1.add(helpMenu);

    setJMenuBar(jMenuBar1);

    pack();
}

From source file:corelyzer.ui.CorelyzerApp.java

private void setupMenuStuff() {
    menuBar = new JMenuBar();

    // Create File Menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);

    JMenuItem createSessionMenuItem = new JMenuItem("Create a Session", KeyEvent.VK_N);
    createSessionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MENU_MASK));
    createSessionMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createSession();/*from   ww w  .  java  2  s .c  om*/
        }
    });
    createSessionMenuItem.setEnabled(true);
    fileMenu.add(createSessionMenuItem);

    createTrackMenuItem = new JMenuItem("Create a Track", KeyEvent.VK_T);
    createTrackMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK));
    createTrackMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.createTrack();
        }
    });
    createTrackMenuItem.setEnabled(false);
    fileMenu.add(createTrackMenuItem);

    fileMenu.addSeparator();

    // Images
    JMenu loadImageMenu = new JMenu("Load Images");
    loadImageMenuItem = new JMenuItem("Open Local Image Files...", KeyEvent.VK_M);
    loadImageMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK));
    loadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageAction();
        }
    });
    loadImageMenu.add(loadImageMenuItem);

    // "Auto-load" 4/25/2012 brg
    JMenuItem autoLoadImageMenuItem = new JMenuItem("Open Image Listing...");
    autoLoadImageMenuItem.setEnabled(true);
    autoLoadImageMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadImageListingAction();
        }
    });
    loadImageMenu.add(autoLoadImageMenuItem);

    // online image services
    JMenuItem chronosMenuItem = new JMenuItem("Online Image Services...");
    loadImageMenu.add(chronosMenuItem);
    chronosMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(1);
            d.setVisible(true);
        }
    });

    fileMenu.add(loadImageMenu);

    // Numbercal data (plots)
    JMenu loadDataMenu = new JMenu("Load Data");

    loadDataMenuItem = new JMenuItem("Open Local Dataset Files", KeyEvent.VK_D);
    loadDataMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK));
    loadDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            Runnable r = new Runnable() {
                public void run() {
                    controller.loadData();
                }
            };

            new Thread(r).start();
        }
    });
    loadDataMenu.add(loadDataMenuItem);
    fileMenu.add(loadDataMenu);

    JMenuItem quickDataImportMenuItem = new JMenuItem("Quick Data Import...");
    quickDataImportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quickDataImport();
        }
    });
    loadDataMenu.add(quickDataImportMenuItem);

    JMenuItem importDataMenuItem = new JMenuItem("Custom Data Import...");
    importDataMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importData();
        }
    });
    loadDataMenu.add(importDataMenuItem);

    // LoggingDB
    JMenuItem loggingDBMenuItem = new JMenuItem("LDEO logging DB...");
    loggingDBMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(2);
            d.setVisible(true);
        }
    });
    loadDataMenu.add(loggingDBMenuItem);

    fileMenu.addSeparator();

    loadStateFileMenuItem = new JMenuItem("Open a Session File", KeyEvent.VK_O);
    loadStateFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MENU_MASK));
    loadStateFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.loadStateFile();
        }
    });
    loadStateFileMenuItem.setEnabled(false);
    fileMenu.add(loadStateFileMenuItem);

    JMenuItem saveMenuItem = new JMenuItem("Save Session", KeyEvent.VK_S);
    saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MENU_MASK));
    saveMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            controller.saveCurrentSession();
        }
    });
    fileMenu.add(saveMenuItem);

    JMenuItem saveStateToFileMenuItem = new JMenuItem("Save Session As...", KeyEvent.VK_S);
    saveStateToFileMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK));
    saveStateToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveStateToFile();
        }
    });
    fileMenu.add(saveStateToFileMenuItem);

    // Session History
    recentSessionsMenu = new JMenu("Recent Sessions");
    controller.refreshSessionHistoryMenu();
    fileMenu.add(recentSessionsMenu);

    fileMenu.addSeparator();

    JMenu packageMenu = new JMenu("Core Archive");
    JMenuItem importMenuItem = new JMenuItem("Import...");
    importMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.importPackage();
        }
    });
    packageMenu.add(importMenuItem);

    JMenuItem exportMenuItem = new JMenuItem("Export...");
    exportMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.exportTheWholeScene();
        }
    });
    packageMenu.add(exportMenuItem);
    fileMenu.add(packageMenu);

    JMenu limsMenu = new JMenu("IODP");

    JMenuItem allIODPLists = new JMenuItem("All IODP lists...");
    allIODPLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    limsMenu.add(allIODPLists);

    JMenuItem loadLIMSTables = new JMenuItem("Load a section list...");
    loadLIMSTables.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadLIMSTables(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(0);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadLIMSTables);

    JMenuItem loadAffineTable = new JMenuItem("Load an affine table...");
    loadAffineTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadAAffineTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(3);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadAffineTable);

    JMenuItem loadSpliceTable = new JMenuItem("Load a splice table...");
    loadSpliceTable.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.loadASpliceTable(getMainFrame());

            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisibleTab(4);
            d.setVisible(true);
        }
    });
    limsMenu.add(loadSpliceTable);

    fileMenu.add(limsMenu);

    JMenu disMenu = new JMenu("DIS");

    JMenuItem disListMenuItem = new JMenuItem("Accessing DIS...");
    disListMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });

    JMenuItem disImport = new JMenuItem("Import...");
    disImport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disImport();
        }
    });
    JMenuItem disExport = new JMenuItem("Export...");
    disExport.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disExport();
        }
    });

    JMenuItem disBatchDataLoad = new JMenuItem("Load Tab Delimited Data File...");
    disBatchDataLoad.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.disBatchDataLoad();
        }
    });

    disMenu.add(disListMenuItem);
    disMenu.add(disImport);
    disMenu.add(disExport);
    disMenu.add(disBatchDataLoad);
    fileMenu.add(disMenu);

    JMenuItem saveOutputToFileMenuItem = new JMenuItem("Export Sheets...", KeyEvent.VK_A);
    saveOutputToFileMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.saveOutputToFile();
        }
    });
    fileMenu.add(saveOutputToFileMenuItem);

    fileMenu.addSeparator();

    JMenuItem quitMenuItem = new JMenuItem("Quit");
    fileMenu.add(quitMenuItem);
    quitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, MENU_MASK));
    quitMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.quit();
        }
    });

    menuBar.add(fileMenu);

    // Create Edit Menu
    JMenu editMenu = new JMenu("Edit");
    editMenu.setMnemonic(KeyEvent.VK_E);

    JMenuItem clearImageCacheMenuItem = new JMenuItem("Clear Image Cache...", KeyEvent.VK_I);
    clearImageCacheMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.clearImageCache();
        }
    });
    editMenu.add(clearImageCacheMenuItem);

    editMenu.addSeparator();
    JMenuItem depthDirection = new JMenuItem("Switch Depth Direction", KeyEvent.VK_K);
    depthDirection.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK));
    depthDirection.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            boolean b = SceneGraph.getDepthOrientation();
            SceneGraph.setDepthOrientation(!b);

            CorelyzerApp.getApp().updateGLWindows();
        }
    });
    editMenu.add(depthDirection);

    JMenuItem tour = new JMenuItem("Tour...");
    tour.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            CRNavigationSetupDialog dlg = new CRNavigationSetupDialog();
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });

    editMenu.add(tour);

    editMenu.addSeparator();
    JMenuItem preferencesMenuItem = new JMenuItem("Preferences...");
    editMenu.add(preferencesMenuItem);
    preferencesMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.doPreferences();
        }
    });

    menuBar.add(editMenu);

    // Create Share Menu
    JMenu shareMenu = new JMenu("Share");

    JMenuItem publishMenuItem = new JMenuItem("Publish...");
    publishMenuItem.setEnabled(true);
    publishMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.publishASession();
        }
    });
    shareMenu.add(publishMenuItem);

    JMenuItem listMenuItem = new JMenuItem("List...");
    listMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            controller.listSessions();
        }
    });
    shareMenu.add(listMenuItem);

    shareMenu.addSeparator();

    friendsMenu = new JMenu("Friends");
    shareMenu.add(friendsMenu);

    menuBar.add(shareMenu);

    // Create Debug Menu
    JMenu debugMenu = new JMenu("Debug");
    debugMenu.setMnemonic(KeyEvent.VK_D);

    JMenuItem matchTestMenuItem = new JMenuItem("Match-Test", KeyEvent.VK_B);
    matchTestMenuItem.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent event) {
            controller.testAndMatch();
        }
    });

    debugMenu.add(matchTestMenuItem);

    if ((System.getenv("DEBUG") != null) && System.getenv("DEBUG").equals("YES")) {
        menuBar.add(shareMenu);
    }

    // Create the Plugin Menu
    pluginMenu = new JMenu("Plugins");
    menuBar.add(pluginMenu);
    pluginMenuItemVec = new Vector<JMenuItem>();

    // Lists
    JMenu listsMenu = new JMenu("Lists");

    JMenuItem iodpLists = new JMenuItem("IODP lists...");
    iodpLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            IODPListsDialog d = new IODPListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(iodpLists);

    JMenuItem disLists = new JMenuItem("DIS lists...");
    disLists.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            DISListsDialog d = new DISListsDialog(getMainFrame());
            d.pack();
            d.setSize(800, 600);
            d.setLocationRelativeTo(getMainFrame());
            d.setVisible(true);
        }
    });
    listsMenu.add(disLists);

    JMenu annotLists = new JMenu("Annotation");

    JMenuItem freeformsItem = new JMenuItem("Default");
    freeformsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            FreeformAnnotationListDialog dlg = new FreeformAnnotationListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(freeformsItem);

    JMenuItem clastListItem = new JMenuItem("Clast");
    clastListItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            ClastStatisticsDialog dlg = new ClastStatisticsDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(clastListItem);

    JMenuItem sampleReqsItem = new JMenuItem("Sample");
    sampleReqsItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            SampleRequestListDialog dlg = new SampleRequestListDialog(getApp().getMainFrame());
            dlg.pack();
            dlg.setLocationRelativeTo(getApp().getMainFrame());
            dlg.onRefresh();

            dlg.setAlwaysOnTop(true);
            dlg.setVisible(true);
        }
    });
    annotLists.add(sampleReqsItem);
    listsMenu.add(annotLists);

    menuBar.add(listsMenu);

    // Create Tools Menu
    JMenu toolsMenu = new JMenu("Tools");
    JMenuItem wholeCoreViewerMenuItem = new JMenuItem("Get 3D Whole Core Imagery Viewer...");
    wholeCoreViewerMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            try {
                String app;
                String url = "http://www.evl.uic.edu/cavern/corewall/SciVizCore/";

                if (System.getProperty("os.name").toLowerCase().contains("windows")) {
                    app = "cmd.exe /c explorer " + url;
                    Runtime.getRuntime().exec(app);
                } else {
                    app = "open";
                    String[] cmd = { app, url };
                    Runtime.getRuntime().exec(cmd);
                }
            } catch (IOException ex) {
                System.err.println("IOException in opening SciVizCore link");
            }
        }
    });

    toolsMenu.add(wholeCoreViewerMenuItem);

    // DEBUG
    String debug = System.getProperty("DEBUG");
    if ((debug != null) && System.getProperty("DEBUG").equals("true")) {
        JMenuItem gcItem = new JMenuItem("GC");
        gcItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- B4 mem:\t" + mem0 / 1000000.0f);

                int trials = 10000;
                for (int i = 0; i < trials; i++) {
                    updateGLWindows();
                }

                long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- " + trials + " mem:\t" + mem1 / 1000000.0f);

                System.gc();
                System.gc();
                System.gc();

                long mem2 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                System.out.println("- AferGC mem:\t" + mem2 / 1000000.0f);
            }
        });
        toolsMenu.add(gcItem);
    }

    menuBar.add(toolsMenu);

    // Create Help Menu
    // Create JavaHelp hooks
    File helpSet = new File("help/jhelpset.hs");
    HelpSet hs = null;
    try {
        URL hsURL = helpSet.toURI().toURL();
        hs = new HelpSet(null, hsURL);
    } catch (HelpSetException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: format error.");
        e.printStackTrace();
    } catch (MalformedURLException e) {
        JOptionPane.showMessageDialog(getMainFrame(), "Cannot find help: malformed URL.");
        e.printStackTrace();
    }

    // Help UI
    JMenu helpMenu = new JMenu("Help");
    JMenuItem helpMenuItem = new JMenuItem("Help", KeyEvent.VK_H);

    if (hs != null) {
        HelpBroker hb = hs.createHelpBroker();
        helpActionListener = new CSH.DisplayHelpFromSource(hb);
        helpMenuItem.addActionListener(helpActionListener);
    } else {
        helpMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent event) {
                controller.helpAction();
            }
        });
    }
    helpMenu.add(helpMenuItem);

    helpMenu.addSeparator();
    JMenuItem aboutMenuItem = new JMenuItem("About Corelyzer");
    helpMenu.add(aboutMenuItem);
    aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent event) {
            controller.about();
        }
    });

    menuBar.add(helpMenu);

    mainFrame.setJMenuBar(menuBar);
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.script.PainelScript.java

private JMenuBar criaMenuBar() {
    menuBar = new JMenuBar();

    menuBar.setBackground(parentFrame.corDefault);

    JMenu menuArquivo = new JMenu(GERAL.ARQUIVO);
    menuArquivo.setMnemonic('A');
    menuArquivo.setMnemonic(KeyEvent.VK_A);
    menuArquivo.setBackground(parentFrame.corDefault);

    JMenu avaliadores = new JMenu();
    MenuSilvinha menuSilvinha = new MenuSilvinha(parentFrame, null);
    menuSilvinha.criaMenuAvaliadores(avaliadores);
    // menuArquivo.add(avaliadores);
    // menuArquivo.add(new JSeparator());

    JMenuItem btnAbrir = new JMenuItem(GERAL.BTN_ABRIR);
    btnAbrir.addActionListener(this);
    btnAbrir.setActionCommand("Abrir");
    btnAbrir.setMnemonic('A');
    btnAbrir.setAccelerator(/*from ww w  . j a v a 2 s . co m*/
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, ActionEvent.CTRL_MASK));
    btnAbrir.setMnemonic(KeyEvent.VK_A);
    btnAbrir.setToolTipText(GERAL.DICA_ABRIR);
    btnAbrir.getAccessibleContext().setAccessibleDescription(GERAL.DICA_ABRIR);
    menuArquivo.add(btnAbrir);

    JMenuItem btnAbrirUrl = new JMenuItem(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.BTN_ABRIR_URL);
    btnAbrirUrl.addActionListener(this);
    btnAbrirUrl.setActionCommand("AbrirURL");
    btnAbrirUrl.setMnemonic('U');
    btnAbrirUrl.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, ActionEvent.CTRL_MASK));
    btnAbrirUrl.setMnemonic(KeyEvent.VK_U);
    btnAbrirUrl.setToolTipText(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    btnAbrirUrl.getAccessibleContext()
            .setAccessibleDescription(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    menuArquivo.add(btnAbrirUrl);

    btnSalvar = new JMenuItem(GERAL.BTN_SALVAR);
    btnSalvar.addActionListener(this);
    btnSalvar.setActionCommand("Salvar");
    btnSalvar.setMnemonic('S');
    btnSalvar.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, ActionEvent.CTRL_MASK));
    btnSalvar.setMnemonic(KeyEvent.VK_S);
    btnSalvar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVA_REAVALIA);
    menuArquivo.add(btnSalvar);

    JMenuItem btnSalvarAs = new JMenuItem(GERAL.BTN_SALVAR_COMO);
    btnSalvarAs.addActionListener(this);
    btnSalvarAs.setActionCommand("SaveAs");
    btnSalvarAs.setMnemonic('c');
    btnSalvarAs.setMnemonic(KeyEvent.VK_C);
    // btnSalvarAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
    // ActionEvent.CTRL_MASK));
    btnSalvarAs.setToolTipText(GERAL.DICA_SALVAR_COMO);
    btnSalvarAs.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR_COMO);
    menuArquivo.add(btnSalvarAs);

    menuArquivo.add(new JSeparator());

    JMenuItem btnFechar = new JMenuItem(GERAL.SAIR);
    btnFechar.addActionListener(this);
    btnFechar.setActionCommand("Sair");
    btnFechar.setMnemonic('a');
    btnFechar.setMnemonic(KeyEvent.VK_A);
    btnFechar.setToolTipText(GERAL.DICA_SAIR);
    btnFechar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SAIR);
    menuArquivo.add(btnFechar);

    menuBar.add(menuArquivo);

    menuBar.add(this.criaMenuEditar());

    menuBar.add(avaliadores);

    JMenu menuSimuladores = new JMenu();
    menuSilvinha.criaMenuSimuladores(menuSimuladores);
    menuBar.add(menuSimuladores);

    JMenu mnFerramenta = new JMenu();
    menuSilvinha.criaMenuFerramentas(mnFerramenta);
    menuBar.add(mnFerramenta);

    JMenu menuAjuda = new JMenu(GERAL.AJUDA);
    menuSilvinha.criaMenuAjuda(menuAjuda);
    menuBar.add(menuAjuda);

    return menuBar;
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.objeto.PainelObjeto.java

private JMenuBar criaMenuBar() {
    menuBar = new JMenuBar();

    menuBar.setBackground(parentFrame.corDefault);

    JMenu menuArquivo = new JMenu(GERAL.ARQUIVO);
    menuArquivo.setMnemonic('A');
    menuArquivo.setMnemonic(KeyEvent.VK_A);
    menuArquivo.setBackground(parentFrame.corDefault);

    JMenu avaliadores = new JMenu();
    MenuSilvinha menuSilvinha = new MenuSilvinha(parentFrame, null);
    menuSilvinha.criaMenuAvaliadores(avaliadores);
    // menuArquivo.add(avaliadores);
    // menuArquivo.add(new JSeparator());

    JMenuItem btnAbrir = new JMenuItem(GERAL.BTN_ABRIR);
    btnAbrir.addActionListener(this);
    btnAbrir.setActionCommand("Abrir");
    btnAbrir.setMnemonic('A');
    btnAbrir.setAccelerator(// ww w .  j  a  v a2 s  .c  o  m
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, ActionEvent.CTRL_MASK));
    btnAbrir.setMnemonic(KeyEvent.VK_A);
    btnAbrir.setToolTipText(GERAL.DICA_ABRIR);
    btnAbrir.getAccessibleContext().setAccessibleDescription(GERAL.DICA_ABRIR);
    menuArquivo.add(btnAbrir);

    JMenuItem btnAbrirUrl = new JMenuItem(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.BTN_ABRIR_URL);
    btnAbrirUrl.addActionListener(this);
    btnAbrirUrl.setActionCommand("AbrirURL");
    btnAbrirUrl.setMnemonic('U');
    btnAbrirUrl.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, ActionEvent.CTRL_MASK));
    btnAbrirUrl.setMnemonic(KeyEvent.VK_U);
    btnAbrirUrl.setToolTipText(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    btnAbrirUrl.getAccessibleContext()
            .setAccessibleDescription(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    menuArquivo.add(btnAbrirUrl);

    btnSalvar = new JMenuItem(GERAL.BTN_SALVAR);
    btnSalvar.addActionListener(this);
    btnSalvar.setActionCommand("Salvar");
    btnSalvar.setMnemonic('S');
    btnSalvar.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, ActionEvent.CTRL_MASK));
    btnSalvar.setMnemonic(KeyEvent.VK_S);
    btnSalvar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVA_REAVALIA);
    // menuArquivo.add(btnSalvar);

    JMenuItem btnSalvarAs = new JMenuItem(GERAL.BTN_SALVAR_COMO);
    btnSalvarAs.addActionListener(this);
    btnSalvarAs.setActionCommand("SaveAs");
    btnSalvarAs.setMnemonic('c');
    btnSalvarAs.setMnemonic(KeyEvent.VK_C);
    // btnSalvarAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
    // ActionEvent.CTRL_MASK));
    btnSalvarAs.setToolTipText(GERAL.DICA_SALVAR_COMO);
    btnSalvarAs.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR_COMO);
    menuArquivo.add(btnSalvarAs);

    menuArquivo.add(new JSeparator());

    JMenuItem btnFechar = new JMenuItem(GERAL.SAIR);
    btnFechar.addActionListener(this);
    btnFechar.setActionCommand("Sair");
    btnFechar.setMnemonic('a');
    btnFechar.setMnemonic(KeyEvent.VK_A);
    btnFechar.setToolTipText(GERAL.DICA_SAIR);
    btnFechar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SAIR);
    menuArquivo.add(btnFechar);

    menuBar.add(menuArquivo);

    menuBar.add(this.criaMenuEditar());

    menuBar.add(avaliadores);

    JMenu menuSimuladores = new JMenu();
    menuSilvinha.criaMenuSimuladores(menuSimuladores);
    menuBar.add(menuSimuladores);

    JMenu mnFerramenta = new JMenu();
    menuSilvinha.criaMenuFerramentas(mnFerramenta);
    menuBar.add(mnFerramenta);

    JMenu menuAjuda = new JMenu(GERAL.AJUDA);
    menuSilvinha.criaMenuAjuda(menuAjuda);
    menuBar.add(menuAjuda);

    return menuBar;
}

From source file:de.codesourcery.jasm16.ide.ui.views.SourceCodeView.java

protected final void setupKeyBindings(final JTextPane editor) {
    // 'Save' action 
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK), new AbstractAction() {
        @Override/* ww  w .  ja  v a  2s  .  co  m*/
        public void actionPerformed(ActionEvent e) {
            saveCurrentFile();
        }
    });

    // 'Underline text when pressing CTRL while hovering over an identifier' 
    editorPane.addKeyListener(new KeyAdapter() {
        private boolean isControlKey(KeyEvent e) {
            return e.getKeyCode() == KeyEvent.VK_CONTROL;
        }

        public void keyPressed(KeyEvent e) {
            if (isControlKey(e)) {
                final Point ptr = getMouseLocation();
                if (ptr != null) {
                    maybeUnderlineIdentifierAt(ptr);
                }
            }
        }

        public void keyReleased(KeyEvent e) {
            if (isControlKey(e)) {
                clearUnderlineHighlight();
            }
        };
    });

    // "Undo" action
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK), undoAction);

    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Y, Event.CTRL_MASK), redoAction);

    // 'Search' action 
    addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK), new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            showSearchDialog();
        }
    });

    setupKeyBindingsHook(editor);
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.label.PainelLabel.java

private JMenuBar criaMenuBar() {
    menuBar = new JMenuBar();

    menuBar.setBackground(parentFrame.corDefault);

    JMenu menuArquivo = new JMenu(GERAL.ARQUIVO);
    menuArquivo.setMnemonic('A');
    menuArquivo.setMnemonic(KeyEvent.VK_A);
    menuArquivo.setBackground(parentFrame.corDefault);

    JMenu avaliadores = new JMenu();
    MenuSilvinha menuSilvinha = new MenuSilvinha(parentFrame, null);
    menuSilvinha.criaMenuAvaliadores(avaliadores);
    // menuArquivo.add(avaliadores);
    // menuArquivo.add(new JSeparator());

    JMenuItem btnAbrir = new JMenuItem(GERAL.BTN_ABRIR);
    btnAbrir.addActionListener(this);
    btnAbrir.setActionCommand("Abrir");
    btnAbrir.setMnemonic('A');
    btnAbrir.setAccelerator(//w  w  w.ja  v a2  s  .c om
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, ActionEvent.CTRL_MASK));
    btnAbrir.setMnemonic(KeyEvent.VK_A);
    btnAbrir.setToolTipText(GERAL.DICA_ABRIR);
    btnAbrir.getAccessibleContext().setAccessibleDescription(GERAL.DICA_ABRIR);
    menuArquivo.add(btnAbrir);

    JMenuItem btnAbrirUrl = new JMenuItem(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.BTN_ABRIR_URL);
    btnAbrirUrl.addActionListener(this);
    btnAbrirUrl.setActionCommand("AbrirURL");
    btnAbrirUrl.setMnemonic('U');
    btnAbrirUrl.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, ActionEvent.CTRL_MASK));
    btnAbrirUrl.setMnemonic(KeyEvent.VK_U);
    btnAbrirUrl.setToolTipText(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    btnAbrirUrl.getAccessibleContext()
            .setAccessibleDescription(br.org.acessobrasil.silvinha2.mli.XHTML_Panel.DICA_ABRIR);
    menuArquivo.add(btnAbrirUrl);

    btnSalvar = new JMenuItem(GERAL.BTN_SALVAR);
    btnSalvar.addActionListener(this);
    btnSalvar.setActionCommand("Salvar");
    btnSalvar.setMnemonic('S');
    btnSalvar.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, ActionEvent.CTRL_MASK));
    btnSalvar.setMnemonic(KeyEvent.VK_S);
    btnSalvar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR);
    menuArquivo.add(btnSalvar);

    JMenuItem btnSalvarAs = new JMenuItem(GERAL.BTN_SALVAR_COMO);
    btnSalvarAs.addActionListener(this);
    btnSalvarAs.setActionCommand("SaveAs");
    btnSalvarAs.setMnemonic('c');
    btnSalvarAs.setMnemonic(KeyEvent.VK_C);
    // btnSalvarAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
    // ActionEvent.CTRL_MASK));
    btnSalvarAs.setToolTipText(GERAL.DICA_SALVAR_COMO);
    btnSalvarAs.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR_COMO);
    menuArquivo.add(btnSalvarAs);

    menuArquivo.add(new JSeparator());

    JMenuItem btnFechar = new JMenuItem(GERAL.SAIR);
    btnFechar.addActionListener(this);
    btnFechar.setActionCommand("Sair");
    btnFechar.setMnemonic('a');
    btnFechar.setMnemonic(KeyEvent.VK_A);
    btnFechar.setToolTipText(GERAL.DICA_SAIR);
    btnFechar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SAIR);
    menuArquivo.add(btnFechar);

    menuBar.add(menuArquivo);

    menuBar.add(this.criaMenuEditar());

    menuBar.add(avaliadores);
    JMenu menuSimuladores = new JMenu();
    menuSilvinha.criaMenuSimuladores(menuSimuladores);
    menuBar.add(menuSimuladores);

    JMenu mnFerramenta = new JMenu();
    menuSilvinha.criaMenuFerramentas(mnFerramenta);
    menuBar.add(mnFerramenta);

    JMenu menuAjuda = new JMenu(XHTML_Panel.AJUDA);
    menuSilvinha.criaMenuAjuda(menuAjuda);
    menuBar.add(menuAjuda);

    return menuBar;
}

From source file:org.forester.archaeopteryx.TreePanel.java

final private void keyPressedCalls(final KeyEvent e) {
    if (isOvOn() && (getMousePosition() != null) && (getMousePosition().getLocation() != null)) {
        if (inOvVirtualRectangle(getMousePosition().x, getMousePosition().y)) {
            if (!isInOvRect()) {
                setInOvRect(true);// w  w  w. j a va  2s .  c  o m
            }
        } else if (isInOvRect()) {
            setInOvRect(false);
        }
    }
    if (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK) {
        if ((e.getKeyCode() == KeyEvent.VK_DELETE) || (e.getKeyCode() == KeyEvent.VK_HOME)
                || (e.getKeyCode() == KeyEvent.VK_F)) {
            getMainPanel().getTreeFontSet().mediumFonts();
            getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(true);
        } else if ((e.getKeyCode() == KeyEvent.VK_SUBTRACT) || (e.getKeyCode() == KeyEvent.VK_MINUS)) {
            getMainPanel().getTreeFontSet().decreaseFontSize();
            getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(true);
        } else if (plusPressed(e.getKeyCode())) {
            getMainPanel().getTreeFontSet().increaseFontSize();
            getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(true);
        }
    } else {
        if ((e.getKeyCode() == KeyEvent.VK_DELETE) || (e.getKeyCode() == KeyEvent.VK_HOME)
                || (e.getKeyCode() == KeyEvent.VK_F)) {
            getControlPanel().showWhole();
        } else if ((e.getKeyCode() == KeyEvent.VK_UP) || (e.getKeyCode() == KeyEvent.VK_DOWN)
                || (e.getKeyCode() == KeyEvent.VK_LEFT) || (e.getKeyCode() == KeyEvent.VK_RIGHT)) {
            if (e.getModifiersEx() == InputEvent.SHIFT_DOWN_MASK) {
                if (e.getKeyCode() == KeyEvent.VK_UP) {
                    getMainPanel().getControlPanel().zoomInY(Constants.WHEEL_ZOOM_IN_FACTOR);
                    getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
                } else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
                    getMainPanel().getControlPanel().zoomOutY(Constants.WHEEL_ZOOM_OUT_FACTOR);
                    getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
                } else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
                    getMainPanel().getControlPanel().zoomOutX(Constants.WHEEL_ZOOM_OUT_FACTOR,
                            Constants.WHEEL_ZOOM_OUT_X_CORRECTION_FACTOR);
                    getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
                } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
                    getMainPanel().getControlPanel().zoomInX(Constants.WHEEL_ZOOM_IN_FACTOR,
                            Constants.WHEEL_ZOOM_IN_FACTOR);
                    getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
                }
            } else {
                final int d = 80;
                int dx = 0;
                int dy = -d;
                if (e.getKeyCode() == KeyEvent.VK_DOWN) {
                    dy = d;
                } else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
                    dx = -d;
                    dy = 0;
                } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
                    dx = d;
                    dy = 0;
                }
                final Point scroll_position = getMainPanel().getCurrentScrollPane().getViewport()
                        .getViewPosition();
                scroll_position.x = scroll_position.x + dx;
                scroll_position.y = scroll_position.y + dy;
                if (scroll_position.x <= 0) {
                    scroll_position.x = 0;
                } else {
                    final int max_x = getMainPanel().getCurrentScrollPane().getHorizontalScrollBar()
                            .getMaximum()
                            - getMainPanel().getCurrentScrollPane().getHorizontalScrollBar().getVisibleAmount();
                    if (scroll_position.x >= max_x) {
                        scroll_position.x = max_x;
                    }
                }
                if (scroll_position.y <= 0) {
                    scroll_position.y = 0;
                } else {
                    final int max_y = getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getMaximum()
                            - getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getVisibleAmount();
                    if (scroll_position.y >= max_y) {
                        scroll_position.y = max_y;
                    }
                }
                repaint();
                getMainPanel().getCurrentScrollPane().getViewport().setViewPosition(scroll_position);
            }
        } else if ((e.getKeyCode() == KeyEvent.VK_SUBTRACT) || (e.getKeyCode() == KeyEvent.VK_MINUS)) {
            getMainPanel().getControlPanel().zoomOutY(Constants.WHEEL_ZOOM_OUT_FACTOR);
            getMainPanel().getControlPanel().zoomOutX(Constants.WHEEL_ZOOM_OUT_FACTOR,
                    Constants.WHEEL_ZOOM_OUT_X_CORRECTION_FACTOR);
            getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
        } else if (plusPressed(e.getKeyCode())) {
            getMainPanel().getControlPanel().zoomInX(Constants.WHEEL_ZOOM_IN_FACTOR,
                    Constants.WHEEL_ZOOM_IN_FACTOR);
            getMainPanel().getControlPanel().zoomInY(Constants.WHEEL_ZOOM_IN_FACTOR);
            getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged(false);
        } else if (e.getKeyCode() == KeyEvent.VK_S) {
            if ((getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED)
                    || (getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR)) {
                setStartingAngle((getStartingAngle() % TWO_PI) + ANGLE_ROTATION_UNIT);
                getControlPanel().displayedPhylogenyMightHaveChanged(false);
            }
        } else if (e.getKeyCode() == KeyEvent.VK_A) {
            if ((getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED)
                    || (getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR)) {
                setStartingAngle((getStartingAngle() % TWO_PI) - ANGLE_ROTATION_UNIT);
                if (getStartingAngle() < 0) {
                    setStartingAngle(TWO_PI + getStartingAngle());
                }
                getControlPanel().displayedPhylogenyMightHaveChanged(false);
            }
        } else if (e.getKeyCode() == KeyEvent.VK_D) {
            boolean selected = false;
            if (getOptions().getNodeLabelDirection() == NODE_LABEL_DIRECTION.HORIZONTAL) {
                getOptions().setNodeLabelDirection(NODE_LABEL_DIRECTION.RADIAL);
                selected = true;
            } else {
                getOptions().setNodeLabelDirection(NODE_LABEL_DIRECTION.HORIZONTAL);
            }
            if (getMainPanel().getMainFrame() == null) {
                // Must be "E" applet version.
                final ArchaeopteryxE ae = (ArchaeopteryxE) ((MainPanelApplets) getMainPanel()).getApplet();
                if (ae.getlabelDirectionCbmi() != null) {
                    ae.getlabelDirectionCbmi().setSelected(selected);
                }
            } else {
                getMainPanel().getMainFrame().getlabelDirectionCbmi().setSelected(selected);
            }
            repaint();
        } else if (e.getKeyCode() == KeyEvent.VK_X) {
            switchDisplaygetPhylogenyGraphicsType();
            repaint();
        } else if (e.getKeyCode() == KeyEvent.VK_C) {
            cycleColors();
            repaint();
        } else if (getOptions().isShowOverview() && isOvOn() && (e.getKeyCode() == KeyEvent.VK_O)) {
            MainFrame.cycleOverview(getOptions(), this);
            repaint();
        } else if (getOptions().isShowOverview() && isOvOn() && (e.getKeyCode() == KeyEvent.VK_I)) {
            increaseOvSize();
        } else if (getOptions().isShowOverview() && isOvOn() && (e.getKeyCode() == KeyEvent.VK_U)) {
            decreaseOvSize();
        }
        e.consume();
    }
}

From source file:view.MainWindow.java

@Override
public boolean dispatchKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED) {
        if (e.isControlDown()) {
            if (e.getKeyCode() == KeyEvent.VK_W) {
                closeDocument(true);//from w  w  w . j a  v a  2  s . c o m
            } else if (e.getKeyCode() == KeyEvent.VK_ADD) {
                workspacePanel.zoomIn();
            } else if (e.getKeyCode() == KeyEvent.VK_SUBTRACT) {
                workspacePanel.zoomOut();
            } else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_RIGHT) {
                workspacePanel.pageUp();
            } else if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_LEFT) {
                workspacePanel.pageDown();
            }
            if (e.isShiftDown()) {
                if (e.getKeyCode() == KeyEvent.VK_S) {
                    workspacePanel.changeCard(WorkspacePanel.CardEnum.SIGN_PANEL, true);
                } else if (e.getKeyCode() == KeyEvent.VK_V) {
                    workspacePanel.changeCard(WorkspacePanel.CardEnum.VALIDATE_PANEL, true);
                }
            }
        }
    } else if (e.getID() == KeyEvent.KEY_RELEASED) {
    } else if (e.getID() == KeyEvent.KEY_TYPED) {
    }
    return false;
}

From source file:savant.view.swing.Savant.java

private void initMenu() {
    loadGenomeItem.setAccelerator(/*from  w  w w  .  j av  a  2  s  . co m*/
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, MiscUtils.MENU_MASK));
    loadFromFileItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, MiscUtils.MENU_MASK));
    loadFromURLItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, MiscUtils.MENU_MASK));
    loadFromDataSourcePluginItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, MiscUtils.MENU_MASK));
    openProjectItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, MiscUtils.MENU_MASK));
    saveProjectItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, MiscUtils.MENU_MASK));
    saveProjectAsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    formatItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, MiscUtils.MENU_MASK));
    exitItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, MiscUtils.MENU_MASK));
    undoItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, MiscUtils.MENU_MASK));
    redoItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, MiscUtils.MENU_MASK));
    bookmarkItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, MiscUtils.MENU_MASK));
    navigationItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.SHIFT_MASK | MiscUtils.MENU_MASK));
    panLeftItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT,
            java.awt.event.InputEvent.SHIFT_MASK));
    panRightItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT,
            java.awt.event.InputEvent.SHIFT_MASK));
    zoomInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP,
            java.awt.event.InputEvent.SHIFT_MASK));
    zoomOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DOWN,
            java.awt.event.InputEvent.SHIFT_MASK));
    toStartItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_HOME,
            java.awt.event.InputEvent.SHIFT_MASK));
    toEndItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_END,
            java.awt.event.InputEvent.SHIFT_MASK));
    preferencesItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, MiscUtils.MENU_MASK));
    crosshairItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, MiscUtils.MENU_MASK));
    plumblineItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, MiscUtils.MENU_MASK));
    spotlightItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, MiscUtils.MENU_MASK));
    bookmarksItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    genomeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    rulerItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    statusBarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    pluginToolbarItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T,
            MiscUtils.MENU_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    exportItem.setAccelerator(
            javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, MiscUtils.MENU_MASK));

    if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
        tutorialsItem.setEnabled(false);
        userManualItem.setEnabled(false);
        websiteItem.setEnabled(false);
    }
    initBrowseMenu();
    try {
        RecentTracksController.getInstance().populateMenu(recentTrackMenu);
        RecentProjectsController.getInstance().populateMenu(recentProjectMenu);
    } catch (IOException ex) {
        LOG.error("Unable to populate Recent Items menu.", ex);
    }

}