Class FileSelectorImpl

java.lang.Object
gov.nih.mipav.view.FileSelectorImpl
All Implemented Interfaces:
FileSelector

public class FileSelectorImpl extends Object implements FileSelector
The implementation of the FileSelector interface for the local file system, for the remote file system you should have different implementation, basically this class is a wrapper of the JFileChooser.
Version:
1.0, 06/21/2006
Author:
Hailong Wang, Ph.D
  • Field Details

  • Constructor Details

    • FileSelectorImpl

      private FileSelectorImpl()
  • Method Details

    • newInstance

      public static FileSelectorImpl newInstance()
    • getFileFilter

      public FileFilter getFileFilter()
      Description copied from interface: FileSelector
      Returns the file filter used by FileSelector.
      Specified by:
      getFileFilter in interface FileSelector
      Returns:
      the file filter used by FileSelector.
      See Also:
    • setFileFilter

      public void setFileFilter(FileFilter fileFilter)
      Description copied from interface: FileSelector
      Sets the file filter to the FileSelector.
      Specified by:
      setFileFilter in interface FileSelector
      Parameters:
      fileFilter - the new file filter.
      See Also:
    • getSelectedFileNames

      public String[] getSelectedFileNames()
      Description copied from interface: FileSelector
      Returns the selected file names. Notes: I want this interface to cover the SRB file selection. So I used the string array as the return type.
      Specified by:
      getSelectedFileNames in interface FileSelector
      Returns:
      the selected file names.
      See Also:
    • showOpenDialog

      public void showOpenDialog(Component parent)
      Description copied from interface: FileSelector
      Shows the open dialog to retrieve the user's input, the approve button will be "Open", and title will be "Open Image", only files are displayed, multi selection will be allowed.
      Specified by:
      showOpenDialog in interface FileSelector
      Parameters:
      parent - the parent component
      See Also:
    • showSaveDialog

      public void showSaveDialog(Component parent)
      Description copied from interface: FileSelector
      Shows the open dialog to retrieve the user's input, the approve button will be "Save", and title will be "Save Image", only directory are displayed, multi selection is not allowed.
      Specified by:
      showSaveDialog in interface FileSelector
      Parameters:
      parent - the parent component
      See Also:
    • showSaveAsDialog

      public void showSaveAsDialog(Component parent)
      Description copied from interface: FileSelector
      Shows the save as dialog to retrieve the user's input, the approve button will be "Save", and title will be "Save Image As", only file are displayed, multi selection is not allowed.
      Specified by:
      showSaveAsDialog in interface FileSelector
      Parameters:
      parent - the parent component
      See Also:
      • invalid reference
        FileSelector#showSaveAsDailog(Component)
    • showDialog

      private void showDialog(Component parent, String title, String approveButtonName)
      Sets up the parameters and show the dialog to let user make selection. If user approves the selection, then stores the image directory.
      Parameters:
      parent - the parent component of the dialog.
      title - the title of the dialog.
      approveButtonName - the approve button name of the dialog.
    • getFileFilter

      private FileFilter getFileFilter(int index)
      A private helper function to get the current used FileFilter from JFileChooser.
      Parameters:
      index - the index of the choosable file filters.
      Returns:
      the current used file filter.
    • main

      public static void main(String[] args)