示例#1
0
  private void openNmrFile() {
    if (fileName.equals("text")) {
      try {
        Runtime.getRuntime().exec("notepad " + fullPath);
      } catch (Exception e) {
      }
    } else if (fileName.equals("fid")) {
      directory = UtilB.windowsPathToUnix(directory);
      if (directory.charAt(directory.length() - 1) == '/') {
        directory = directory.substring(0, directory.length() - 1);
      }
      Util.sendToVnmr("rt (\'" + directory + "\')");
      Util.sendToVnmr("write(\'line3\',\'fid retrieved\')");
    } else if (fileName.equals("procpar")) {
      directory = UtilB.windowsPathToUnix(directory);
      if (directory.charAt(directory.length() - 1) == '/') {
        directory = directory.substring(0, directory.length() - 1);
      }
      Util.sendToVnmr("rtp (\'" + directory + "\')");
      Util.sendToVnmr("write(\'line3\',\'parameters retrieved\')");
    } else {
      Util.sendToVnmr("write(\'error\',\'unknown file -- open ignored\')");
    }

    return;
  }
示例#2
0
 public void setVisible(boolean v) {
   // for now, we probably never call this with "false" but
   // just to do something sane we do this ...
   super.setVisible(v);
   if (!v) {
     return;
   }
   fileName = this.getFile();
   directory = this.getDirectory();
   fullPath = directory + fileName;
   if (!getDirectoryExtension(directory).equals("fid")) {
     Util.sendToVnmr("write(\'error\',\'unknown file -- open ignored\')");
   } else {
     if (mode == FileDialog.LOAD) {
       openNmrFile();
     } else if (mode == FileDialog.SAVE) {
       saveFID();
     }
   }
   this.dispose();
 }