Logo Search packages:      
Sourcecode: wims version File versions  Download package

void ptolemy::plot::PlotFrame::_saveAs (  )  [inline, protected]

Query the user for a filename and save the plot to that file.

Definition at line 498 of file PlotFrame.java.

References _directory, _file, and _save().

Referenced by _save().

        JFileChooser fileDialog = new JFileChooser();
        fileDialog.addChoosableFileFilter(new PLTOrXMLFileFilter());
        fileDialog.setDialogTitle("Save plot as...");

        if (_directory != null) {
        } else {
            // The default on Windows is to open at user.home, which is
            // typically an absurd directory inside the O/S installation.
            // So we use the current directory instead.
            String cwd = StringUtilities.getProperty("user.dir");

            if (cwd != null) {
                fileDialog.setCurrentDirectory(new File(cwd));

        fileDialog.setSelectedFile(new File(fileDialog.getCurrentDirectory(),

        int returnVal = fileDialog.showSaveDialog(this);

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            _file = fileDialog.getSelectedFile();
            _directory = fileDialog.getCurrentDirectory();

Generated by  Doxygen 1.6.0   Back to index