Package ij.io

Examples of ij.io.SaveDialog


        title=title.substring(0,length-i);
        break;
      }

    if (path==null || path.equals("")) {
      SaveDialog od = new SaveDialog("PNM Writer", title, extension);
      String dir=od.getDirectory();
      String name=od.getFileName();
      if(name==null)
        return;
      path = dir + name;
    }
View Full Code Here


  public boolean saveAs(String path) {
    boolean isResults = IJ.isResultsWindow() && IJ.getTextPanel()==this;
    if (path.equals("")) {
      IJ.wait(10);
      String ext = isResults?Prefs.get("options.ext", ".xls"):".txt";
      SaveDialog sd = new SaveDialog("Save as Text", title, ext);
      String file = sd.getFileName();
      if (file == null) return false;
      path = sd.getDirectory() + file;
    }
    PrintWriter pw = null;
    try {
      FileOutputStream fos = new FileOutputStream(path);
      BufferedOutputStream bos = new BufferedOutputStream(fos);
View Full Code Here

        gd.addChoice("Convert to: ", choices, format);
        gd.showDialog();
        if (gd.wasCanceled())
            return;
        format = gd.getNextChoice();
        SaveDialog sd = new SaveDialog("Open destination folder...", "dummy name (required)", "");
        if (sd.getFileName()==null) return;
        String dir2 = sd.getDirectory();
        convert(dir1, dir2, format);
    }
View Full Code Here

    }
    if (rt!=null && rt.getCounter()!=0 && !summarized) {
      if (path==null || path.equals("")) {
        IJ.wait(10);
        String name = isResults?"Results":title;
        SaveDialog sd = new SaveDialog("Save Results", name, Prefs.get("options.ext", ".xls"));
        String file = sd.getFileName();
        if (file==null) return false;
        path = sd.getDirectory() + file;
      }
      try {
        rt.saveAs(path);
      } catch (IOException e) {
        IJ.error(""+e);
      }
    } else {
      if (path.equals("")) {
        IJ.wait(10);
        boolean hasHeadings = !getColumnHeadings().equals("");
        String ext = isResults||hasHeadings?Prefs.get("options.ext", ".xls"):".txt";
        if (ext.equals(".csv")) ext = ".txt";
        SaveDialog sd = new SaveDialog("Save as Text", title, ext);
        String file = sd.getFileName();
        if (file == null) return false;
        path = sd.getDirectory() + file;
      }
      PrintWriter pw = null;
      try {
        FileOutputStream fos = new FileOutputStream(path);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
View Full Code Here

        title=title.substring(0,length-i);
        break;
      }

    if (path==null || path.equals("")) {
      SaveDialog od = new SaveDialog("PNM Writer", title, extension);
      String dir=od.getDirectory();
      String name=od.getFileName();
      if(name==null)
        return;
      path = dir + name;
    }
View Full Code Here

       Displays a file save dialog if 'path' is empty or null. Does nothing if the
       table is empty. */
  public void saveAs(String path) throws IOException {
    if (getCounter()==0 && lastColumn<0) return;
    if (path==null || path.equals("")) {
      SaveDialog sd = new SaveDialog("Save Results", "Results", Prefs.get("options.ext", ".xls"));
      String file = sd.getFileName();
      if (file==null) return;
      path = sd.getDirectory() + file;
    }
    delimiter = path.endsWith(".csv")?',':'\t';
    PrintWriter pw = null;
    FileOutputStream fos = new FileOutputStream(path);
    BufferedOutputStream bos = new BufferedOutputStream(fos);
View Full Code Here

      if (name1.endsWith(".txt")||name1.endsWith(".ijm"))
        defaultDir = Menus.getMacrosPath();
      else
        defaultDir = Menus.getPlugInsPath();
    }
    SaveDialog sd = new SaveDialog("Save As...", defaultDir, name1, null);
    String name2 = sd.getFileName();
    String dir = sd.getDirectory();
    if (name2!=null) {
      if (name2.endsWith(".java"))
        updateClassName(name1, name2);
      path = dir+name2;
      save();
View Full Code Here

      if (name1.endsWith(".txt")||name1.endsWith(".ijm"))
        defaultDir = Menus.getMacrosPath();
      else
        defaultDir = Menus.getPlugInsPath();
    }
    SaveDialog sd = new SaveDialog("Save As...", defaultDir, name1, null);
    String name2 = sd.getFileName();
    String dir = sd.getDirectory();
    if (name2!=null) {
      if (name2.endsWith(".java"))
        updateClassName(name1, name2);
      path = dir+name2;
      save();
View Full Code Here

    boolean isResults = IJ.isResultsWindow() && IJ.getTextPanel()==this;
    if (path.equals("")) {
      IJ.wait(10);
      boolean hasHeadings = !getColumnHeadings().equals("");
      String ext = isResults||hasHeadings?Prefs.get("options.ext", ".xls"):".txt";
      SaveDialog sd = new SaveDialog("Save as Text", title, ext);
      String file = sd.getFileName();
      if (file == null) return false;
      path = sd.getDirectory() + file;
    }
    PrintWriter pw = null;
    try {
      FileOutputStream fos = new FileOutputStream(path);
      BufferedOutputStream bos = new BufferedOutputStream(fos);
View Full Code Here

TOP

Related Classes of ij.io.SaveDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.