Ejemplo n.º 1
0
    public void actionPerformed(ActionEvent ev) {

      try {

        String[] logFiles = new String[] {"log"};

        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Opening log file...");
        chooser.setMultiSelectionEnabled(false);
        chooser.addChoosableFileFilter(new SimpleFileFilter(logFiles, "Log files (*.log)"));
        chooser.setCurrentDirectory(workingDirectory);

        chooser.showOpenDialog(Utils.getActiveFrame());
        File file = chooser.getSelectedFile();
        logFilename = file.getAbsolutePath();
        System.out.println("Opened " + logFilename + "\n");

        File tmpDir = chooser.getCurrentDirectory();

        if (tmpDir != null) {
          workingDirectory = tmpDir;
        }

      } catch (Exception e) {
        System.err.println("Could not Open! \n");
      }
    }
Ejemplo n.º 2
0
    public void actionPerformed(ActionEvent ev) {

      Color c =
          ColorPicker.showDialog(
              Utils.getActiveFrame(), "Choose maximum branches color...", branchesMaxColor, true);

      if (c != null) branchesMaxColor = c;
    }
Ejemplo n.º 3
0
    public void actionPerformed(ActionEvent ev) {

      try {

        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Saving as png file...");

        chooser.showSaveDialog(Utils.getActiveFrame());
        File file = chooser.getSelectedFile();
        String plotToSaveFilename = file.getAbsolutePath();

        rateIndicatorBFToProcessing.save(plotToSaveFilename);
        System.out.println("Saved " + plotToSaveFilename + "\n");

      } catch (Exception e) {
        System.err.println("Could not save! \n");
      }
    } // END: actionPerformed
Ejemplo n.º 4
0
    public void actionPerformed(ActionEvent ev) {

      try {

        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Loading locations file...");
        chooser.setCurrentDirectory(workingDirectory);

        chooser.showOpenDialog(Utils.getActiveFrame());
        File file = chooser.getSelectedFile();
        locationsFilename = file.getAbsolutePath();
        System.out.println("Opened " + locationsFilename + "\n");

        File tmpDir = chooser.getCurrentDirectory();

        if (tmpDir != null) {
          workingDirectory = tmpDir;
        }

      } catch (Exception e1) {
        System.err.println("Could not Open! \n");
      }
    }