Package com.atolsystems.atolutilities

Examples of com.atolsystems.atolutilities.AFileChooser


        return copy;
    }

    //ask user where to save the data
    File askForFile() {
        AFileChooser fileChooser;//a custom JFileChooser which remembers last location
        fileChooser = new AFileChooser((java.awt.Frame) null, true, LAST_DATA_FILE_PATH_KEY);
        fileChooser.setDialogTitle("Select a file to save random data");
        FileNameExtensionFilter filter = new FileNameExtensionFilter("raw data file", "dat");
        fileChooser.addChoosableFileFilter(filter);
        fileChooser.setAcceptAllFileFilterUsed(true);
        long start = System.nanoTime();
        int option = fileChooser.showOpenDialog(null);
        deadTime += System.nanoTime() - start;
        fileChooser.dispose();
        if (option != JFileChooser.APPROVE_OPTION) {
            throw new StopRequestFromUserException();//if user give up, we give up too...
        }
        fileChooser.saveCurrentPath();//tell the file chooser to remember this location
        outputFile = fileChooser.getSelectedFile();
        outputFileClonned = false;
        return outputFile;
    }
View Full Code Here


            System.out.println(msg);
        }
    }

    static AFileChooser buildFileChooser() {
        AFileChooser fileChooser;
        fileChooser = new AFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("arg files", "arg");
        fileChooser.addChoosableFileFilter(filter);
        filter = new FileNameExtensionFilter("txt & cmd files", "txt", "cmd");
        fileChooser.addChoosableFileFilter(filter);
        fileChooser.setAcceptAllFileFilterUsed(true);
        return fileChooser;
    }
View Full Code Here

    protected static File askForFile() throws StopRequestFromUserException {
        File out;
        //if(null==fileChooser)
        //    buildFileChooser();
        AFileChooser fileChooser = buildFileChooser();
        long start = System.nanoTime();
        //fileChooser.setModalityType(ModalityType.TOOLKIT_MODAL);
        int option = fileChooser.showOpenDialog(null);
        fileChooser.saveCurrentPath();
        out = fileChooser.getSelectedFile();
        long end = System.nanoTime();
        fileChooser.dispose();
        deadTime += end - start;
        if (option != JFileChooser.APPROVE_OPTION) {
            throw new StopRequestFromUserException();
        }
        return out;
View Full Code Here

TOP

Related Classes of com.atolsystems.atolutilities.AFileChooser

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.