Package diva.gui

Class AbstractStoragePolicy

  • All Implemented Interfaces:
    StoragePolicy
    Direct Known Subclasses:
    BasicStoragePolicy, DefaultStoragePolicy

    public abstract class AbstractStoragePolicy
    extends java.lang.Object
    implements StoragePolicy
    It is nice if storage policies suggest good pathnames. Usually the file they last opened. This abstract class provides such functionality.
    Version:
    $Id$
    Author:
    Steve Neuendorffer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDirectory()
      Return a reasonable directory for file choosers to use.
      void setDirectory​(java.io.File file)
      Set the current browsed directory to that given in the file.
      void setDirectory​(java.lang.String directory)
      Set the current browsed directory to that given directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractStoragePolicy

        public AbstractStoragePolicy()
    • Method Detail

      • getDirectory

        public java.lang.String getDirectory()
        Return a reasonable directory for file choosers to use. If a directory has been set using setDirectory, then use that. Otherwise use the user's current working directory. If all else fails, then use user's home directory. If THAT fails, then just dump them into the root of the file system.
      • setDirectory

        public void setDirectory​(java.io.File file)
        Set the current browsed directory to that given in the file.
      • setDirectory

        public void setDirectory​(java.lang.String directory)
        Set the current browsed directory to that given directory. The directory is assumed to exist.