GEN-LAST:event_menuValidateBodyActionPerformed
486000
private void menuExecuteBodyActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_menuExecuteBodyActionPerformed
		SQLPPTriplesMap mapping = mappingList.getSelectedValue();
		if (mapping == null) {
			return;
		}
		final String sqlQuery = mapping.getSourceQuery().toString();

		SQLQueryPanel pnlQueryResult = new SQLQueryPanel(selectedSource, sqlQuery);

		JDialog dlgQueryResult = new JDialog();
		DialogUtils.installEscapeCloseOperation(dlgQueryResult);
		dlgQueryResult.setContentPane(pnlQueryResult);
		dlgQueryResult.pack();
		dlgQueryResult.setLocationRelativeTo(this);
		dlgQueryResult.setVisible(true);
		dlgQueryResult.setTitle("SQL Query Result");
	}
310555
private void jButtonInPathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonInPathActionPerformed
        path = getDirectory("open", JFileChooser.DIRECTORIES_ONLY);
        if (!path.equals("")) {
            reset();
            resetP();
            this.jTextFieldResultPath.setText(path);
             rf = new ReadFile(path);
            String str = rf.processFiles();
            if (str.equals("")) {

                int algSize = rf.getAlgShortNames().size();
                int streamSize = rf.getStream().size();
                this.measures = rf.getMeasures();
                for (int i = 0; i < algSize; i++) {
                    this.algoritmModel.addRow(new Object[]{rf.getAlgNames().get(i), rf.getAlgShortNames().get(i)});
                }
                for (int i = 0; i < streamSize; i++) {
                    this.streamModel.addRow(new Object[]{rf.getStream().get(i), rf.getStream().get(i)});
                }

                String measuresNames[] = measures.getFirst().split(",");
                for (String measuresName : measuresNames) {
                    jComboBoxXColumn.addItem(measuresName);
                    jComboBoxYColumn.addItem(measuresName);
                    jComboBoxXColumnGnuP.addItem(measuresName);
                    jComboBoxYColumnGnuP.addItem(measuresName);
                    if (measuresName.equals("learning evaluation instances") == true) {
                        jComboBoxXColumn.setSelectedItem(measuresName);
                        jComboBoxXColumnGnuP.setSelectedItem(measuresName);
                    }
                    if (measuresName.equals("classifications correct (percent)") == true
                            || measuresName.equals("[avg] classifications correct (percent)") == true) {
                        jComboBoxYColumn.setSelectedItem(measuresName);
                        jComboBoxYColumnGnuP.setSelectedItem(measuresName);
                    }

                }
            } else {

                JOptionPane.showMessageDialog(this, str,
                        "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    }
435555
private void menuEditMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_menuEditMenuSelected
    final TabTitle title = this.getFocusedTab();
    updateMenuItemsForProvider(title == null ? null : title.getProvider());
    this.menuEditShowTreeContextMenu.setEnabled(this.explorerTree.hasSelectedItem());
  }
328944
private void buttonAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAboutActionPerformed
    JOptionPane.showMessageDialog(this, new AboutPanel(), "About", JOptionPane.PLAIN_MESSAGE);
  }
581388
private void menuFullScreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFullScreenActionPerformed

    final AbstractEditor selectedEditor = this.tabPane.getCurrentEditor();
    if (selectedEditor != null) {
      final GraphicsConfiguration gconfig = this.getGraphicsConfiguration();
      if (gconfig != null) {
        final GraphicsDevice device = gconfig.getDevice();
        if (device.isFullScreenSupported()) {
          if (device.getFullScreenWindow() == null) {
            final JLabel label = new JLabel("Opened in full screen");
            final int tabIndex = this.tabPane.getSelectedIndex();
            this.tabPane.setComponentAt(tabIndex, label);
            final JWindow window = new JWindow(Main.getApplicationFrame());
            window.setAlwaysOnTop(true);
            window.setAutoRequestFocus(true);
            window.setContentPane(selectedEditor.getContainerToShow());

            endFullScreenIfActive();

            final KeyEventDispatcher fullScreenEscCatcher = (@Nonnull final KeyEvent e) -> {
              if (e.getID() == KeyEvent.KEY_PRESSED && (e.getKeyCode() == KeyEvent.VK_ESCAPE || e.getKeyCode() == KeyEvent.VK_F11)) {
                endFullScreenIfActive();
                return true;
              }
              return false;
            };

            if (this.taskToEndFullScreen.compareAndSet(null, (Runnable) () -> {
              try {
                window.dispose();
              } finally {
                tabPane.setComponentAt(tabIndex, selectedEditor.getContainerToShow());
                device.setFullScreenWindow(null);
                KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(fullScreenEscCatcher);
              }
            })) {
              try {
                KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(fullScreenEscCatcher);
                device.setFullScreenWindow(window);
              } catch (Exception ex) {
                LOGGER.error("Can't turn on full screen", ex); //NOI18N
                endFullScreenIfActive();
                KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(fullScreenEscCatcher);
              }
            } else {
              LOGGER.error("Unexpected state, processor is not null!"); //NOI18N
            }
          } else {
            LOGGER.warn("Attempt to full screen device which already in full screen!"); //NOI18N
          }
        } else {
          LOGGER.warn("Device doesn's support full screen"); //NOI18N
          DialogProviderManager.getInstance().getDialogProvider().msgWarn(this, "The Device doesn't support full-screen mode!");
        }
      } else {
        LOGGER.warn("Can't find graphics config for the frame"); //NOI18N
      }
    }
  }
1114218
public void actionPerformed(ActionEvent ev) {

        if (ev.getSource() instanceof TextField) {
            saveTable();

            return;
        }

        String   s = ev.getActionCommand();
        MenuItem i = new MenuItem();

        if (s == null) {
            if (ev.getSource() instanceof MenuItem) {
                i = (MenuItem) ev.getSource();
                s = i.getLabel();
            }
        }

        if (s == null) {}

        if (s.equals("Start Transfer") || s.equals("ReStart Transfer")) {
            bStart.setLabel("ReStart Transfer");
            bStart.invalidate();

            CurrentTransfer = 0;
            CurrentAlter    = 0;

            transfer();
        } else if (s.equals("Continue Transfer")) {
            transfer();
        } else if (s.equals("Start Dump") || s.equals("Start Restore")) {
            CurrentTransfer = 0;
            CurrentAlter    = 0;

            transfer();
        } else if (s.equals("Quit")) {
            exit();
        } else if (s.indexOf("Select Schema") >= 0) {
            String[] selection = lTable.getSelectedItems();

            if ((selection == null) || (selection.length == 0)) {
                return;
            }

            if (iSelectionStep == Transfer.SELECT_SOURCE_SCHEMA) {
                sSourceSchemas = selection;
            } else {
                sDestSchema = selection[0];
            }

            if (iTransferMode == TRFM_DUMP) {
                iSelectionStep = Transfer.SELECT_SOURCE_TABLES;
            } else {
                iSelectionStep++;
            }

            ProcessNextStep();
        } else if (s.indexOf("Select Catalog") >= 0) {
            String selection = lTable.getSelectedItem();

            if ((selection == null) || (selection.equals(""))) {
                return;
            }

            if (iSelectionStep == Transfer.SELECT_SOURCE_CATALOG) {
                sSourceCatalog = selection;
                sSourceSchemas = null;
            } else {
                sDestCatalog = selection;
                sDestSchema  = null;

                try {
                    targetDb.setCatalog(sDestCatalog);
                } catch (Exception ex) {
                    trace("Catalog " + sDestCatalog
                          + " could not be selected in the target database");

                    sDestCatalog = null;
                }
            }

            iSelectionStep++;

            ProcessNextStep();
        } else if (s.equals("Insert 10 rows only")) {
            iMaxRows = 10;
        } else if (s.equals("Insert 1000 rows only")) {
            iMaxRows = 1000;
        } else if (s.equals("Insert all rows")) {
            iMaxRows = 0;
        } else if (s.equals("Load Settings...")) {
            FileDialog f = new FileDialog(fMain, "Load Settings",
                                          FileDialog.LOAD);

            f.show();

            String file = f.getDirectory() + f.getFile();

            if (file != null) {
                LoadPrefs(file);
                displayTable(tCurrent);
            }
        } else if (s.equals("Save Settings...")) {
            FileDialog f = new FileDialog(fMain, "Save Settings",
                                          FileDialog.SAVE);

            f.show();

            String file = f.getDirectory() + f.getFile();

            if (file != null) {
                SavePrefs(file);
            }
        } else if (s.equals("Exit")) {
            windowClosing(null);
        }
    }
1164837
private synchronized void cmdSaveChangesActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonSaveActionPerformed
		final String query = queryTextPane.getText();
		if (!currentId.isEmpty()) {
			if (!currentGroup.isEmpty()) {
				qc.addQuery(query, currentId, currentGroup);
			} else {
				qc.addQuery(query, currentId);
			}
		} else {
			JOptionPane.showMessageDialog(QueryInterfacePanel.this,
					"Please select first the query node that you would like to update",
					"Warning",
					JOptionPane.WARNING_MESSAGE);
		}	
	}
172762
private void _saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__saveActionPerformed
        int[] i = _oList.getSelectedRows();
        String[] o = new String[i.length];
        for (int j = 0; j < i.length; j++) {
            o[j] = (String) _oList.getValueAt(i[j], 0);
        }
        JFileChooser fc = new JFileChooser();
        fc.setFileFilter(new FileNameExtensionFilter("R data file", "Rdata"));
        if (R != null) {
            fc.setSelectedFile(new File(R.cat("_", o) + ".Rdata"));
            if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFile() != null) {
                try {
                    R.save(fc.getSelectedFile(), o);
                } catch (Rsession.RException ex) {
                    ex.printStackTrace();
                }
            }
        }
    }
937459
private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_nextButtonActionPerformed

        discover = new Thread() {
            @Override
            public void run() {
                IErrorLogger errorLogger = new IErrorLogger() {
                    @Override
                    public void reportMissingClass(ClassNotFoundException ex) {
                        String className = ClassNotFoundExceptionParser.getMissingClassName(ex);
                        if (className != null) {
                            logError("Missing class: " + className);
                        } else {
                            logError("Missing class: " + ex);
                        }
                    }

                    @Override
                    public void reportMissingClass(ClassDescriptor classDescriptor) {
                        logError("Missing class: " + classDescriptor.toDottedClassName());
                    }

                    @Override
                    public void logError(String message) {
                        System.err.println("Error: " + message);
                    }

                    @Override
                    public void logError(String message, Throwable e) {
                        logError(message + ": " + e.getMessage());
                    }

                    @Override
                    public void reportSkippedAnalysis(MethodDescriptor method) {
                        logError("Skipped analysis of method " + method.toString());
                    }
                };

                DiscoverSourceDirectories.Progress progress = new DiscoverSourceDirectories.Progress() {

                    @Override
                    public void startRecursiveDirectorySearch() {
                        progressModel.addElement("Scanning directories...");
                    }

                    @Override
                    public void doneRecursiveDirectorySearch() {
                    }

                    @Override
                    public void startScanningArchives(int numArchivesToScan) {
                        progressModel.addElement("Scanning " + numArchivesToScan + " archives..");
                    }

                    @Override
                    public void doneScanningArchives() {
                    }

                    @Override
                    public void startScanningClasses(int numClassesToScan) {
                        progressModel.addElement("Scanning " + numClassesToScan + " classes...");
                    }

                    @Override
                    public void finishClass() {
                    }

                    @Override
                    public void doneScanningClasses() {
                    }

                    @Override
                    public void finishArchive() {
                    }

                    @Override
                    public void startArchive(String name) {
                    }
                };
                DiscoverSourceDirectories discoverSourceDirectories = new DiscoverSourceDirectories();
                discoverSourceDirectories.setProject(project);
                discoverSourceDirectories.setRootSourceDirectory(sourceRootBox.getText());
                discoverSourceDirectories.setErrorLogger(errorLogger);
                discoverSourceDirectories.setProgress(progress);

                try {
                    discoverSourceDirectories.execute();
                } catch (CheckedAnalysisException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (InterruptedException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                jList1.setModel(foundModel);

                for (String srcDir : discoverSourceDirectories.getDiscoveredSourceDirectoryList()) {
                    foundModel.addElement(srcDir);
                }

                if (step < MAX_STEP) {
                    setStep(step + 1);
                }
            }
        };
        discover.start();
    }
768782
private void backgroundButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backgroundButtonActionPerformed
        Color color = ScreenUtil.getColor(ScreenUtil.BACKGROUND_COLOR, null, properties);
        color = JColorChooser.showDialog(this, java.util.ResourceBundle.getBundle(DIALOG_BUNDLE).getString("choosebackgroundcolor"), color);
        if (color != null)
            ScreenUtil.setColor(ScreenUtil.BACKGROUND_COLOR, new ColorUIResource(color), null, properties);
        else
            properties.remove(ScreenUtil.BACKGROUND_COLOR);
        
        ScreenUtil.updateLookAndFeel(this, null, properties);
        this.setSampleStyle();
    }
1127146
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        JavaProcessBuilder pb = SAMPLE_QUEUE.newProcessBuilder(Locale.getDefault());
        pb.setProcessName("Test 5");
        pb.setProcessDescription("Test 5");
        Test2Runner runner = new Test2Runner();
        pb.setProcessDetails(runner, "run", new Class[] {Integer.TYPE}, new Object[] {(Integer)jSpinner1.getValue()});
        pb.addProcessSection(runner, "waitForProcess", new Class[] {}, new Object[] {});
        pb.setProcessPersistence(true);
        pb.newProcess();
    }
206052
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        feedback = UserFeedback.Ok;
        synchronized (WAITER_LOCK) {
            okButton.setEnabled(false);
            cancelButton.setEnabled(false);
            WAITER_LOCK.notifyAll();
        }
    }
79157
private void menuEditPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuEditPasteActionPerformed
    final TabTitle title = this.getFocusedTab();
    if (title != null && title.getProvider().doesSupportCutCopyPaste()) {
      title.getProvider().doPaste();
    }
    updateMenuItemsForProvider(title == null ? null : title.getProvider());
  }
547711
private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
    final File home = new File(System.getProperty("user.home")); //NOI18N
    final File toSave = new FileChooserBuilder("user-home-dir").
        setTitle(java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle")).
        addFileFilter(TEXT_FILE_FILTER).setFileFilter(TEXT_FILE_FILTER).
        setFilesOnly(true).
        setDefaultWorkingDirectory(home).
        showSaveDialog();
    if (toSave != null) {
      try {
        final String text = getText();
        FileUtils.writeStringToFile(toSave, text, "UTF-8"); //NOI18N
      }
      catch (Exception ex) {
        LOGGER.error("Error during text file saving", ex); //NOI18N
        NbUtils.msgError(null, java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("PlainTextEditor.buttonSaveActionPerformed.msgError"));
      }
    }
  }
28163
private void runBatchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runBatchButtonActionPerformed
        // Perform batch encoding
        String thisData = "";
        String extension;
        String fullFileName;
        String outputCount;
        int inputCount = 0;
        String errorLog;
        String progressLog = "";
        int i, k;
        int lineCount = 0;
        double percentage;
        int countLength, currentLength;

        errorLog = "Starting batch process..." + '\n';
        batchOutputArea.setText(errorLog);

        switch(outFormatCombo.getSelectedIndex()) {
            case 0:
                extension = ".png";
                break;
            case 1:
                extension = ".jpg";
                break;
            case 2:
                extension = ".gif";
                break;
            case 3:
                extension = ".bmp";
                break;
            case 4:
                extension = ".svg";
                break;
            case 5:
            default:
                extension = ".eps";
                break;
        }

        for(i = 0; i < sequenceArea.getText().length(); i++) {
            if (sequenceArea.getText().charAt(i) == '\n') {
                inputCount++;
            }
        }

        countLength = Integer.toString(inputCount + 1).length();

        for(i = 0; i < sequenceArea.getText().length(); i++) {
            if (sequenceArea.getText().charAt(i) == '\n') {
                currentLength = Integer.toString(lineCount + 1).length();
                outputCount = "";
                for (k = 0; k < (countLength - currentLength); k++) {
                    // Add leading zeroes to file name
                    outputCount += "0";
                }
                outputCount += Integer.toString(lineCount + 1);
                if (!thisData.equals("")) {
                    if (outFilenameCombo.getSelectedIndex() == 0) {
                        fullFileName = folderField.getText() + prefixField.getText()
                            + osFriendly(thisData) + extension;
                    } else {
                        fullFileName = folderField.getText()
                                + prefixField.getText() + outputCount + extension;
                    }
                    File file = new File(fullFileName);
                    SaveSymbol saveSymbol = new SaveSymbol();

                    saveSymbol.removeAll();

                    saveSymbol.setSize(saveSymbol.getPreferredSize());
                    saveSymbol.setBorder(BorderFactory.createEmptyBorder());
                    saveSymbol.setBackground(paperColour);
                    try {
                        SaveImage saveImage = new SaveImage();
                        if (errorLabel.getText().isEmpty()) {
                            saveImage.save(file, saveSymbol);
                        } else {
                            errorLog += errorLabel.getText() + " at line " + (lineCount + 1) + '\n';
                        }
                    } catch (IOException e) {
                        errorLog += "I/O exception writing to " + fullFileName
                                + " at line " + (lineCount + 1) + ": " + e.getMessage() + '\n';
                    }
                }
                lineCount++;
                percentage = (double)(lineCount) / (double)(inputCount);
                percentage *= 100;
                progressLog = "Completed line " + lineCount + " of "
                        + inputCount + " (" + (int)(percentage) + "% done)";
                batchOutputArea.setText(errorLog + progressLog);
                thisData = "";
            } else {
                char currentChar = sequenceArea.getText().charAt(i);

                if ((currentChar != 0x0D) && (currentChar != 0x0A)) {
                    thisData += sequenceArea.getText().charAt(i);
                }
            }
        }
        progressLog += '\n' + "Finished!";
        batchOutputArea.setText(errorLog + progressLog);
    }
854796
private void settingsLoadMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_settingsLoadMenuItemActionPerformed
        JFileChooser fc = new JFileChooser();
        if (settingsFile != null) {
            fc.setSelectedFile(settingsFile);
        } else {
            fc.setSelectedFile(DEFAULT_SETTINGS_FILE);
        }
        int returnVal = fc.showOpenDialog(this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            try {
                loadSettings(file);
            } catch (Exception ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,
                        "Could not load settings from \"" + file + "\"", ex);
            }
        }

    }
660249
private void cmdCreateNewActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAcceptActionPerformed
		String id = txtQueryID.getText();
		String group = (String) cmbQueryGroup.getSelectedItem();

		if (id.isEmpty()) {
			JOptionPane.showMessageDialog(this, "The query ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		final int index = queryController.getElementPosition(id);
		if (index != -1) {
			JOptionPane.showMessageDialog(this, "The query or group ID already exists!", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}

		if (group.equals(NOGROUP)) { // no group selected
			queryController.addQuery(query, id);
		} else if (group.equals(NEWGROUP)) { // create a new group
			group = txtGroupName.getText().trim();
			if (group.isEmpty()) {
				JOptionPane.showMessageDialog(this, "The group ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
				return;
			}
			//query and group ID have not yet been added to the queryController elements, but we need to prevent the use of the same name for both
			if (id.equals(group)){
                JOptionPane.showMessageDialog(this, "The group ID can't have the same name as the query ID!", "Error", JOptionPane.ERROR_MESSAGE);
                return;
            }
			try {
				queryController.createGroup(group);
				queryController.addQuery(query, id, group);
			} catch (Exception e) {

                OptionPaneUtils.showPrettyMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);

				return;
			}
		} else { // a group selected
			queryController.addQuery(query, id, group);
		}
		parent.dispose();
	}