GEN-LAST:event_menuOpenProjectActionPerformed
506518
@Nonnull
  @ReturnsOriginal
  @SuppressWarnings("ResultOfMethodCallIgnored")
  public NodeProject asyncReloadProject(@Nonnull final NodeProject project, @Nullable final Runnable... invokeLater) {
    assertSwingThread();

    LOGGER.info("Starting asyncronous loading of " + project.toString());

    project.initLoading(Mono.just(project)
            .publishOn(PARALLEL_SCHEDULER)
            .map(proj -> {
              SwingUtilities.invokeLater(() -> ProjectLoadingIconAnimationController.getInstance().registerLoadingProject(this.explorerTree.getProjectTree(), proj));
              return proj;
            })
            .flatMap(proj -> proj.readSubtree(PrefUtils.isShowHiddenFilesAndFolders()))
            .doOnError(error -> {
              LOGGER.error("Can't open project", error);
              SwingUtilities.invokeLater(() -> {
                JOptionPane.showMessageDialog(rootPane, "Can't open project : " + error.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
              });
            })
            .doOnTerminate(() -> {
              ProjectLoadingIconAnimationController.getInstance().unregisterLoadingProject(project);
              if (invokeLater != null && invokeLater.length > 0) {
                for (final Runnable r : invokeLater) {
                  SwingUtilities.invokeLater(r);
                }
              }
            }).subscribe());
    return project;
  }
441337
private void btLaunchActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btLaunchActionPerformed
    {//GEN-HEADEREND:event_btLaunchActionPerformed
      try
      {
        Desktop.getDesktop().browse(new URI(
          "http://localhost:" + webServerPort + "/annis-gui/"));
      }
      catch (IOException | URISyntaxException ex)
      {
       ImportStatus importStatus = corpusAdministration
          .getAdministrationDao().initImportStatus();
        importStatus.addException("unknown exception", ex);
        new ExceptionDialog(importStatus).setVisible(true);
      }

    }
674582
private void aboutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutButtonActionPerformed
        // Show information about Okapi
        AboutOkapi az = new AboutOkapi();
        az.setLocationRelativeTo(this);
        az.setVisible(true);
    }
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);
            }
        }

    }
265343
private void comboXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboXActionPerformed
        if (visualizer == null) return;
        JComboBox cb = (JComboBox)evt.getSource();
        int dim = cb.getSelectedIndex();
        streamPanel0.setActiveXDim(dim);
        streamPanel1.setActiveXDim(dim);
        if(visualizer!=null)
            visualizer.redraw();
    }
1271153
private void _addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__addActionPerformed
        JFileChooser fc = new JFileChooser();
        fc.setMultiSelectionEnabled(true);
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setFileFilter(new FileFilter() {

            @Override
            public boolean accept(File f) {
                return f.isDirectory() || f.getName().endsWith(".R") || f.getName().endsWith(".Rdata");
            }

            @Override
            public String getDescription() {
                return "R object file";
            }
        });
        if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFiles() != null) {
            File[] files = fc.getSelectedFiles();
            for (File file : files) {
                if (file.getName().endsWith(".R")) {
                    if (R != null) {
                        R.source(file);
                    }
                } else if (file.getName().endsWith(".Rdata")) {
                    if (R != null) {
                        R.load(file);
                    }
                } else {
                    Log.Out.println("Not loading/sourcing " + file.getName());
                }
            }
        }
        update();
    }
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());
    }
  }
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);

    }
1151419
private void cmdExportResultActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonSaveResultsActionPerformed
		JFileChooser fileChooser = new JFileChooser(System.getProperty("user.dir"));
		fileChooser.setDialogTitle("Export to...");
		int response = fileChooser.showSaveDialog(this);
		if (response == JFileChooser.APPROVE_OPTION) {
			File targetFile = fileChooser.getSelectedFile();
			final String fileLocation = targetFile.getPath();
			if (canWrite(targetFile)) {
				Thread thread = new Thread() {
					public void run() {						
						getOBDASaveQueryToFileAction().run(fileLocation);
					}
				};
				thread.start();
			}
		}
	}
912467
private void buttonResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonResetActionPerformed
    makeModelAndSetToTable(SystemFileExtensionManager.getInstance().getDefaultExtensionsAsCommaSeparatedString());
  }
791299
private void batchFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_batchFileButtonActionPerformed
        // Load a batch file
        JFileChooser fileChooser = new JFileChooser();
        if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
            try (BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                        new FileInputStream(file), "UTF8"))) {
                String str;

                sequenceArea.setText("");

                while ((str = in.readLine()) != null) {
                    sequenceArea.setText(sequenceArea.getText() + str + '\n');
                }
            } catch (UnsupportedEncodingException e) {
                System.out.println("Encoding exception");
            } catch (IOException e) {
                System.out.println("Cannot read from file" + fileChooser.getSelectedFile().toString());
            } catch (Exception e) {
                System.out.println("Exception");
            }

        }
    }
933199
private void cmdRemoveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_removeQueryButtonActionPerformed
		TreePath selected_path = treSavedQuery.getSelectionPath();
		if (selected_path == null)
			return;

		if (JOptionPane.showConfirmDialog(this, "This will delete the selected query. \n Continue? ", "Delete confirmation",
				JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION) == JOptionPane.CANCEL_OPTION) {
			return;
		}

		DefaultMutableTreeNode node = (DefaultMutableTreeNode) selected_path.getLastPathComponent();
		if (node instanceof TreeElement) {
			TreeElement element = (TreeElement) node;
			QueryController qc = this.queryController;
			if (node instanceof QueryTreeElement) {
				qc.removeQuery(element.getID());
			} else if (node instanceof QueryGroupTreeElement) {
				qc.removeGroup(element.getID());
			}
		}
		
		
	}
796608
private void checkboxDrawPointsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkboxDrawPointsActionPerformed
        visualizer.setPointLayerVisibility(checkboxDrawPoints.isSelected());
    }
756185
private void colorChooserGridColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooserGridColorActionPerformed
    if (this.colorChooserGridColor.isLastOkPressed() && changeNotificationAllowed) {
      this.controller.changed();
    }
  }
574170
private void directoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_directoryButtonActionPerformed
        // Select save directory
        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Directory Select");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);
        if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            folderField.setText(chooser.getSelectedFile().getAbsolutePath()
                    + File.separator);
        }
    }
937494
private void menuOpenFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuOpenFileActionPerformed
    final File file = DialogProviderManager.getInstance().getDialogProvider().msgOpenFileDialog(null, "open-file", "Open file", null, true, MMDEditor.MMD_FILE_FILTER, "Open");
    if (file != null) {
      if (openFileAsTab(file, -1)) {
        try {
          FileHistoryManager.getInstance().registerOpenedProject(file);
        } catch (IOException ex) {
          LOGGER.error("Can't register last opened file", ex); //NOI18N
        }
      }
    }
  }
751600
private void jRadioButtonGraphAggregatedActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButtonGraphAggregatedActionPerformed
    {//GEN-HEADEREND:event_jRadioButtonGraphAggregatedActionPerformed
        parent.switchModel(true);
        refreshGraphPreview();
    }