GEN-LAST:event_btInitActionPerformed
505200
private void btImportActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btImportActionPerformed
    {//GEN-HEADEREND:event_btImportActionPerformed

      ImportDialog dlg = new ImportDialog(this, true, corpusAdministration);
      dlg.setVisible(true);

    }
1146846
private void buttonAddLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddLineActionPerformed
    ((DefaultTableModel)this.tableExtensions.getModel()).addRow(new String[]{""});
  }
911646
private void chkRewriteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkRewriteActionPerformed
        preference.put(OntopReformulationSettings.EXISTENTIAL_REASONING, String.valueOf(chkRewrite.isSelected()));

    }
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());
    }
  }
762790
private void cmdCancelOperationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdCancelOperationActionPerformed
		try {
			monitor.cancel();
		} 
		catch (Exception e) {
            OptionPaneUtils.showPrettyMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
		}
	}
756185
private void colorChooserGridColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserGridColorActionPerformed
    if (this.colorChooserGridColor.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
555153
private void buttonCollapseAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCollapseAllActionPerformed
    Utils.foldUnfoldTree(this.treeMindMap, false);
  }
1148083
private void cmbJDBCURLItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbJDBCURLItemStateChanged
    {//GEN-HEADEREND:event_cmbJDBCURLItemStateChanged
        if (this.cmbJDBCDriver.getSelectedItem() != null &&
            this.cmbJDBCURL.getSelectedItem() != null)
        {
            this.pbTest.setEnabled(true);
            this.pbOpen.setEnabled(true);
        }
        else
        {
            this.pbTest.setEnabled(false);
            this.pbOpen.setEnabled(false);        
        }            
    }
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();
	}
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();

      }

    }
1184847
private void finshButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_finshButtonActionPerformed
        if (parentGUI != null) {
            parentGUI.setSourceDirecs(foundModel);
        }
        if (discover != null && discover.isAlive()) {
            discover.stop();
        }
        dispose();
    }
645748
private void buttonExpandAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExpandAllActionPerformed
    Utils.foldUnfoldTree(this.treeMindMap, true);
  }
88255
private void cmdCancelActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cmdCancelActionPerformed
		parent.setVisible(false);
		parent.dispose();
		releaseResultset();
	}
553446
private void cmbSQLTypeActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_cmbSQLTypeActionPerformed
  {//GEN-HEADEREND:event_cmbSQLTypeActionPerformed
    // Add your handling code here:
//    System.out.println(this.jComboBox1.getSelectedItem());
    aColumn.setColumnType(this.cmbSQLType.getSelectedItem().toString());
  }
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;
			}
		}

	}
539145
private void cmdCreateMappingActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cmdCreateMappingActionPerformed
		// Stop any editing action and save whatever in the text field
		if (!pnlPropertyEditorList.isEmpty() && pnlPropertyEditorList.isEditing()) {
			pnlPropertyEditorList.stopCellEditing();
		}
		try {
			// Prepare the mapping source
			String source = txtQueryEditor.getText();

			if (source.isEmpty()) {
				JOptionPane.showMessageDialog(this, "ERROR: The SQL source cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
				return;
			}
			String subjectTargetString = predicateSubjectMap.getTargetMapping();
			if(subjectTargetString.equals(":")){
				JOptionPane.showMessageDialog(this, "ERROR: Focus on URI cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
				return;
			}
			// Prepare the mapping target
			List<MapItem> predicateObjectMapsList = pnlPropertyEditorList.getPredicateObjectMapsList();
			ImmutableList<TargetAtom> target = prepareTargetQuery(predicateSubjectMap, predicateObjectMapsList);

			if (target.isEmpty()) {
				JOptionPane.showMessageDialog(this, "ERROR: The target cannot be empty. Add a class or a property", "Error", JOptionPane.ERROR_MESSAGE);
				return;
			}
			// Create the mapping axiom
			SQLPPTriplesMap mappingAxiom = new OntopNativeSQLPPTriplesMap(MAPPING_FACTORY.getSQLQuery(source), target);
			obdaModel.addTriplesMap(mappingAxiom, false);

			// Clear the form afterwards
			clearForm();
		} catch (DuplicateMappingException e) {
			DialogUtils.showQuickErrorDialog(null, e, "Duplicate mapping identification.");
			return;
		} catch (NullPointerException e) {
			DialogUtils.showQuickErrorDialog(null, new Exception("Data source has not been defined."));
			return;
		} catch (RuntimeException e) {
			DialogUtils.showQuickErrorDialog(null, e, "Empty property mapping.");
			return;
		}
	}
1292833
private void checkboxDrawGTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkboxDrawGTActionPerformed
        //visualizer.redrawClusterings();
        visualizer.setGroundTruthVisibility(checkboxDrawGT.isSelected());
    }