GEN-LAST:event_cbAutoUpdateActionPerformed
326358
private void cbAutoRetrieveActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_cbAutoRetrieveActionPerformed
  {//GEN-HEADEREND:event_cbAutoRetrieveActionPerformed
    // Add your handling code here:
    aRelation.setAutoRetrieve(cbAutoRetrieve.isSelected());
  }
1035994
private void previousButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_previousButtonActionPerformed
        if (step > MIN_STEP) {
            setStep(step - 1);
        }
        progressModel.removeAllElements();
        foundModel.removeAllElements();
    }
1367490
private void loadDataButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadDataButtonActionPerformed
        // Load more data from file
        MoreData addme = new MoreData();
        addme.setLocationRelativeTo(this);
        addme.setVisible(true);
    }
395375
private void cmdDuplicateMappingActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_duplicateMappingButtonActionPerformed
		Object[] currentSelection = mappingList.getSelectedValues();
		if (currentSelection == null) {
			JOptionPane.showMessageDialog(this, "No mappings have been selected", "ERROR", JOptionPane.ERROR_MESSAGE);
			return;
		}
		int confirm = JOptionPane.showConfirmDialog(
				this,
				"This will create copies of the selected mappings. \nNumber of mappings selected = "
				+ currentSelection.length + "\nContinue? ", 
				"Copy confirmation", 
				JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
		
		if (confirm == JOptionPane.NO_OPTION || confirm == JOptionPane.CANCEL_OPTION || confirm == JOptionPane.CLOSED_OPTION) {
			return;
		}
		OBDAModel controller = apic;
		URI current_srcuri = selectedSource.getSourceID();

		for (int i = 0; i < currentSelection.length; i++) {
			SQLPPTriplesMap mapping = (SQLPPTriplesMap) currentSelection[i];

			String id = mapping.getId();

			// Computing the next available ID
			int new_index = -1;
			for (int index = 0; index < 999999999; index++) {
				if (controller.indexOf(current_srcuri, id + "(" + index + ")") == -1) {
					new_index = index;
					break;
				}
			}
			String newId = id + "(" + new_index + ")";

			// inserting the new mapping
			try {

				SQLPPTriplesMap oldmapping = controller.getTriplesMap(id);
				SQLPPTriplesMap newmapping = new OntopNativeSQLPPTriplesMap(newId, oldmapping.getSourceQuery(),
                        oldmapping.getTargetAtoms());
				controller.addTriplesMap(current_srcuri, newmapping, false);

			} catch (DuplicateMappingException e) {
				JOptionPane.showMessageDialog(this, "Duplicate Mapping: " + newId);
				return;
			}
		}

	}
294787
private void btCancelActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btCancelActionPerformed
    {//GEN-HEADEREND:event_btCancelActionPerformed

      if (isImporting)
      {
        worker.cancel(true);
        statementController.cancelStatements();
      }
      setVisible(false);
    }
328944
private void buttonAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAboutActionPerformed
    JOptionPane.showMessageDialog(this, new AboutPanel(), "About", JOptionPane.PLAIN_MESSAGE);
  }
978716
private void jComboBoxGranulationActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jComboBoxGranulationActionPerformed
    {//GEN-HEADEREND:event_jComboBoxGranulationActionPerformed
        //notify parent if value changed and valid
        int newValue = getValueFromString((String) jComboBoxGranulation.getSelectedItem());
        if (newValue != -1 && parent.getGranulation() != newValue) {
            parent.setGranulation(newValue);
        }
    }
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();

      }

    }
93869
private void cboDataSetActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cboDataSetActionPerformed
		txtQueryEditor.setText(EMPTY_TEXT); // clear the text editor
		JComboBox cb = (JComboBox) evt.getSource();
		if (cb.getSelectedIndex() != -1) {
			RelationDefinition dd = (RelationDefinition) cb.getSelectedItem();
			if (dd != null) {
				String sql = generateSQLString(dd);
				txtQueryEditor.setText(sql);
			}
			executeQuery();
			txtClassUriTemplate.requestFocus();
		}
	}
755373
private void buttonFontForEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonFontForEditorActionPerformed
    final FontSelector fontSelector = new FontSelector(this.fontTextEditor);
    if (DialogProviderManager.getInstance().getDialogProvider().msgOkCancel(this, "Select Text editor font", fontSelector)) {
      this.fontTextEditor = fontSelector.getValue();
      updateFontButton(this.buttonFontForEditor, fontSelector.getValue());
      if (this.changeNotificationAllowed) {
        this.changed = true;
      }
    }
  }
446522
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        // Exit dialogue and send content to main window
        OkapiUI.dataInputField.setText(dataInputArea.getText());
        dispose();
    }
56474
private void cmdAddActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cmdAddActionPerformed
		Object item = cboPropertyAutoSuggest.getSelectedItem();
		addPredicateProperty(item);
		validatePredicateProperty();
	}
1214581
private void menuUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuUndoActionPerformed
    final TabTitle title = this.getFocusedTab();
    if (title != null) {
      this.menuUndo.setEnabled(title.getProvider().undo());
      this.menuRedo.setEnabled(title.getProvider().isRedo());
    }
  }
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);
    }
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);
        }

    }
931401
private void cmdAttachPrefixActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAdvancedPropertiesActionPerformed
		SelectPrefixPanel dialog = new SelectPrefixPanel(apic.getMutablePrefixManager(), queryTextPane);
		dialog.show();
	}
1150044
private void buttonEditKeyCodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEditKeyCodeActionPerformed
    if (this.buttonEditKeyCode.isSelected()){
      this.textFieldKeyCode.requestFocus();
    }
  }