GEN-LAST:event_buttonStopActionPerformed
779867
private void loadOptionsFromFile(String filepath){
        try {
            BufferedReader in = new BufferedReader(new FileReader(filepath));

            String stream0 = in.readLine();
            outlierAlgoPanel0.setStreamValueAsCLIString(stream0);

            String algo0 = in.readLine();
            outlierAlgoPanel0.setAlgorithm0ValueAsCLIString(algo0);

            System.out.println("Loading settings from "+filepath);
            logPanel.addText("Loading settings from "+filepath);

        } catch (Exception e) {
            System.out.println("Bad option file:"+e.getMessage());
        }
    }
1067787
private void btDeleteActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btDeleteActionPerformed
    {//GEN-HEADEREND:event_btDeleteActionPerformed

      int row = tableList.getSelectedRow();
      int col = tableModel.findColumn("id");

      if(row > -1 && col > -1)
      {
        Object value = tableModel.getValueAt(row, col);
        final LinkedList<Long> corpusListToDelete = new LinkedList<Long>();
        long l = Long.parseLong(value.toString());
        corpusListToDelete.add(l);

        pbDelete.setIndeterminate(true);
        btClose.setEnabled(false);
        btDelete.setEnabled(false);

        SwingWorker<String, Void> worker = new SwingWorker<String, Void>()
        {

          @Override
          protected String doInBackground() throws Exception
          {
            corpusAdmin.deleteCorpora(corpusListToDelete);
            updateTable();
            return "";
          }

          @Override
          protected void done()
          {
            pbDelete.setIndeterminate(false);
            pbDelete.setValue(100);
            btClose.setEnabled(true);
            btDelete.setEnabled(true);
          }
        };

        worker.execute();

      }

    }
1145738
private void jButtonAceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptActionPerformed

        int algCount = this.jTableAlgoritms.getRowCount();
        int streamCount = this.jTableStreams.getRowCount();
        chart = new ImageChart[streamCount];

        for (int i = 0; i < streamCount; i++) {
            String streamName = this.jTableStreams.getModel().getValueAt(i, 0).toString();
            String streamID = this.jTableStreams.getModel().getValueAt(i, 1).toString();
            XYSeriesCollection dataset = new XYSeriesCollection();
            for (int j = 0; j < algCount; j++) {
                try {
                    String algName = this.jTableAlgoritms.getModel().getValueAt(j, 0).toString();
                    String algID = this.jTableAlgoritms.getModel().getValueAt(j, 1).toString();
                    String algPath = FilenameUtils.separatorsToSystem(
                            this.path + "\\" + streamName + "\\" + algName);
                    File inputFile = new File(algPath);
                    if (!inputFile.exists()) {
                        JOptionPane.showMessageDialog(this, "File not found: "
                                + inputFile.getAbsolutePath(),
                                "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                    }
                    /*Preparing the graph*/
                    ArrayList<String[]> data = readCSV(algPath);
                    XYSeries series = new XYSeries(algID);
                    int x = ReadFile.getMeasureIndex(algPath,this.jComboBoxXColumn.getSelectedItem().toString());
                    int y = ReadFile.getMeasureIndex(algPath,this.jComboBoxYColumn.getSelectedItem().toString());
                    
                    for (String[] s : data) {
                        series.add(Double.parseDouble(s[x]), Double.parseDouble(s[y]));
                    }

                    dataset.addSeries(series);

                } catch (FileNotFoundException ex) {
                    Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IOException ex) {
                    Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex);
                }
            }//end for 
            /*Create chart*/
            JFreeChart imgChart = ChartFactory.createXYLineChart(
                    this.jTextFieldTitle.getText(), // Title
                    this.jTextFieldxTitle.getText(), // x-axis Label
                    this.jTextFieldyTitle.getText(), // y-axis Label
                    dataset, // Dataset
                    PlotOrientation.VERTICAL, // Plot Orientation
                    true, // Show Legend
                    true, // Use tooltips
                    false // Configure chart to generate URLs?
            );
            final XYPlot plot = imgChart.getXYPlot();
            switch (this.jComboBoxGrid.getSelectedItem().toString()) {
                case "White":
                    plot.setBackgroundPaint(Color.white);
                    break;
                case "Default":
                    plot.setBackgroundPaint(Color.lightGray);
            }
            if (this.jCheckBoxShape.isSelected()) {
                final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
                renderer.setSeriesLinesVisible(0, true);
                renderer.setSeriesShapesVisible(1, false);
                for (int k = 0; k < algCount; k++) {
                    renderer.setSeriesPaint(k, Color.black);
                }
                plot.setRenderer(renderer);
            }

            this.chart[i] = new ImageChart(streamID, imgChart,
                    (int) this.jSpinnerWidth.getValue(), (int) this.jSpinnerHeight.getValue());

        }
        this.imgPanel = new ImageTreePanel(chart);
        new ImageViewer(imgPanel, path);

    }
102286
private void colorChooserRootTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserRootTextActionPerformed
    if (this.colorChooserRootText.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
1219277
private void buttonScreenshotMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonScreenshotMouseClicked
        BaseFileChooser fileChooser = new BaseFileChooser();
        fileChooser.setAcceptAllFileFilterUsed(true);
        if(screenshotFilebase!=null)
            fileChooser.setSelectedFile(new File(screenshotFilebase));
        if (fileChooser.showSaveDialog(this) == BaseFileChooser.APPROVE_OPTION) {
        	screenshotFilebase = fileChooser.getSelectedFile().getPath();
        	streamPanel0.screenshot(screenshotFilebase+"_"+label_processed_points_value.getText()+"_0", true, true);
        }
    }
385453
private void jButtonGnuoPathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGnuoPathActionPerformed
        this.jTextFieldGNUPath.setText(getDirectory("open", JFileChooser.DIRECTORIES_ONLY));
    }
845947
private void jButtonAceptGnuPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptGnuPActionPerformed

        if (!this.jTextFieldResultPath.getText().equals("")) {
            String outPath = getDirectory("open", JFileChooser.DIRECTORIES_ONLY);
            if(!outPath.equals("")){
                
            File resultFile = new File(this.jTextFieldResultPath.getText());
            String resultDirectory = resultFile.getAbsolutePath();
            String gnuPlotPath = this.jTextFieldGNUPath.getText();
            String gnuplotScriptPath = null;
            File gnuplotDir = new File(gnuPlotPath);
            if (!gnuplotDir.exists()) {
                JOptionPane.showMessageDialog(this, "Gnuplot directory not found: " + gnuPlotPath, "Error", JOptionPane.ERROR_MESSAGE);
                return;
            }
            String algShortName[] = new String[this.jTableAlgoritms.getRowCount()];
            String algName[] = new String[this.jTableAlgoritms.getRowCount()];
            for (int i = 0; i < this.jTableStreams.getRowCount(); i++) {
                String streamName = this.jTableStreams.getModel().getValueAt(i, 0).toString();
                String streamShortName = this.jTableStreams.getModel().getValueAt(i, 1).toString();
                for (int j = 0; j < this.jTableAlgoritms.getRowCount(); j++) {
                    algName[j] = this.jTableAlgoritms.getModel().getValueAt(j, 0).toString();
                    algShortName[j] = this.jTableAlgoritms.getModel().getValueAt(j, 1).toString();
                    File inputFile = new File(FilenameUtils.separatorsToSystem(
                            this.path + "\\" + streamName + "\\" + algName[j]));

                    if (!inputFile.exists()) {
                        JOptionPane.showMessageDialog(this, "File not found: "
                                + inputFile.getAbsolutePath(),
                                "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                    }

                }

                gnuplotScriptPath = resultDirectory + File.separator
                        + resultFile.getName() + ".plt";
                String script = createScript(streamName, algName, algShortName, outPath);
                File scriptFile = writeScriptToFile(gnuplotScriptPath, script);
                String gnuplotCommand = gnuPlotPath + File.separator + "gnuplot \""
                        + gnuplotScriptPath + "\"";
                String line, gnuplotOutput = "";
                try {
                    Process p = Runtime.getRuntime().exec(gnuplotCommand);

                    BufferedReader err = new BufferedReader(new InputStreamReader(p
                            .getErrorStream()));
                    while ((line = err.readLine()) != null) {
                        gnuplotOutput += line + System.getProperty("line.separator");
                    }
                    err.close();
                } catch (IOException ex) {
                    JOptionPane.showMessageDialog(this, "Error while executing gnuplot script",
                            "Error", JOptionPane.ERROR_MESSAGE);
                    throw new RuntimeException("Error while executing gnuplot script:"
                            + scriptFile, ex);

                }
                if (this.jCheckBoxDeleteScript.isSelected()) {
                    scriptFile.delete();
                }
            }

            //Completed
            JOptionPane.showMessageDialog(this, "Figures created at " + (new File(resultFile.getAbsolutePath())).getParent(),
                    "", JOptionPane.INFORMATION_MESSAGE);
        }
        } else {
            JOptionPane.showMessageDialog(this, "Plot output file option not set!",
                    "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
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"));
      }
    }
  }
435099
private void buttonAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAboutActionPerformed
    NbUtils.plainMessageOk(null, java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("MMDCfgPanel.buttonAbout.Text"), new AboutPanel());
  }
539643
private void buttonBrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBrowseActionPerformed
    final String selectedText = this.editorPane.getSelectedText().trim();
    try {
      UiUtils.browseURI(URI.create(selectedText), false);
    } catch (Exception ex) {
      LOGGER.error("Can't open link : " + selectedText); //NOI18N
      DialogProviderManager.getInstance().getDialogProvider().msgError(Main.getApplicationFrame(), "Can't browse link : " + selectedText);
    }
  }
642907
private void buttonOpenShortcutEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOpenShortcutEditorActionPerformed
    final List<KeyShortcut> list = new ArrayList<KeyShortcut>();
    for (final Map.Entry<String, KeyShortcut> e : this.mapKeyShortCuts.entrySet()) {
      list.add(e.getValue());
    }
    final KeyShortCutEditPanel panel = new KeyShortCutEditPanel(list);
    if (NbUtils.plainMessageOkCancel(null, "Edit shortcuts", panel)) {
      for (final KeyShortcut s : panel.getResult()) {
        this.mapKeyShortCuts.put(s.getID(), s);
      }
      this.controller.changed();
    }
  }
687146
private void _updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__updateActionPerformed
        jTextPane1.setText("");
        String text = new String(buffer, 0, pos);
        String[] lines = text.split("\n");

        Style style = jTextPane1.getStyle("INFO");
        for (String line : lines) {
            if (line.startsWith("o ")) {
                line = line.substring(2);
                style = jTextPane1.getStyle("OUTPUT");
            } else if (line.startsWith("i ")) {
                line = line.substring(2);
                style = jTextPane1.getStyle("INFO");
            } else if (line.startsWith("w ")) {
                line = line.substring(2);
                style = jTextPane1.getStyle("WARN");
            } else if (line.startsWith("e ")) {
                line = line.substring(2);
                style = jTextPane1.getStyle("ERROR");
            }

            try {
                jTextPane1.getDocument().insertString(jTextPane1.getDocument().getLength(), line + "\n", style);
                jTextPane1.setCaretPosition(jTextPane1.getDocument().getLength());
            } catch (Exception e) {
                 Log.Err.println(e.getMessage());
            }
        }
    }
265018
private void resetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetButtonActionPerformed
        //clear the existing values from the table    
        DefaultTableModel model = (DefaultTableModel) rules.getModel();
        model.setRowCount(0);
        
        //remove existing match rules from the scan
        scan.clearMatchRules();

        //load the defaults
        urlTextField.setText(DEFAULT_URL);
        
        //issue request to URL
        MatchRulesLoader loader = new MatchRulesLoader(DEFAULT_URL);
        loader.start();
    }
317145
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        JavaProcessBuilder pb = SAMPLE_QUEUE.newProcessBuilder(Locale.getDefault());
        pb.setProcessName("Test 3");
        pb.setProcessDescription("Test 3");
        pb.setProcessDetails(new TestRunner(), "run", new Class[] {}, new Object[] {});
        pb.setProcessPersistence(true);
        pb.newProcess();
    }
1108326
private void colorChooserCollapsatorBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserCollapsatorBackgroundActionPerformed
    if (changeNotificationAllowed && this.colorChooserCollapsatorBackground.isLastOkPressed()) {
      this.controller.changed();
    }
  }
840805
private void openButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openButtonActionPerformed
		final File dir = lastOpenDirectory();
		final JFileChooser chooser = dir != null
			? new JFileChooser(dir)
			: new JFileChooser();
		chooser.setDialogTitle("Choose Image");
		chooser.setDialogType(JFileChooser.OPEN_DIALOG);
		chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
		chooser.setMultiSelectionEnabled(false);
		chooser.addChoosableFileFilter(new FileNameExtensionFilter(
			format(
				"Images (%s)",
				Stream.of(ImageIO.getReaderFileSuffixes())
					.map(s -> format(" *.%s", s))
					.collect(Collectors.joining(","))
			),
			ImageIO.getReaderFileSuffixes()
		));

		final int returnVal = chooser.showOpenDialog(this);
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			final File imageFile = chooser.getSelectedFile();
			try {
				update(ImageIO.read(imageFile));
				if (imageFile.getParentFile() != null) {
					lastOpenDirectory(imageFile.getParentFile());
				}
			} catch (IOException e) {
				JOptionPane.showMessageDialog(
					rootPane,
					format("Error while loading image '%s'.", imageFile),
					e.toString(),
					JOptionPane.ERROR_MESSAGE
				);
			}
		}
	}
220013
private void buttonDeleteLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDeleteLineActionPerformed
    ((DefaultTableModel)this.tableExtensions.getModel()).removeRow(this.tableExtensions.getSelectedRow());
  }