edu.cornell.cs.sam.ui.components
Class FileDialogManager

java.lang.Object
  extended by edu.cornell.cs.sam.ui.components.FileDialogManager

public class FileDialogManager
extends java.lang.Object


Nested Class Summary
 class FileDialogManager.SimpleFilter
          A File filter that checks for a simple extension
 
Constructor Summary
FileDialogManager(int n)
          Initialize with n file dialogs - all of which save the last location/type of file opened
 
Method Summary
 java.io.File getOpenDirectory(java.awt.Component parent, java.io.File cdir, int n)
          Runs open dialog and returns the directory selected, or null if canceled
 java.io.File getOpenFile(java.awt.Component parent, java.lang.String extension, java.lang.String filetype, java.io.File cdir, int n)
          Runs open dialog and returns the file selected, or null if canceled
 java.io.File getSaveFile(java.awt.Component parent, java.lang.String extension, java.lang.String filetype, java.io.File cdir, int n)
          Runs file selection dialog and returns the File selected or null if canceled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDialogManager

public FileDialogManager(int n)
Initialize with n file dialogs - all of which save the last location/type of file opened

Parameters:
n - the number of file dialogs to have
Method Detail

getOpenFile

public java.io.File getOpenFile(java.awt.Component parent,
                                java.lang.String extension,
                                java.lang.String filetype,
                                java.io.File cdir,
                                int n)
Runs open dialog and returns the file selected, or null if canceled

Parameters:
parent - the parent Component
filetype - the file type to be saved
extension - the extension for this filetype
cdir - File to set current directory or null otherwise
n - Code of the open dialog

getSaveFile

public java.io.File getSaveFile(java.awt.Component parent,
                                java.lang.String extension,
                                java.lang.String filetype,
                                java.io.File cdir,
                                int n)
Runs file selection dialog and returns the File selected or null if canceled

Parameters:
parent - the parent Component
filetype - the file type to be saved
extension - the extension for this filetype
cdir - file to set current directory or null
n - Code of the save dialog

getOpenDirectory

public java.io.File getOpenDirectory(java.awt.Component parent,
                                     java.io.File cdir,
                                     int n)
Runs open dialog and returns the directory selected, or null if canceled

Parameters:
parent - the parent Component
cdir - File to set current directory or null otherwise
n - which chooser to display